Kicksecure Coding Style
Documentation for this is incomplete. Contributions are happily considered! See this for potential alternatives.
Contents
Simplicity
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Simplicity
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#Simplicity|Simplicity]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Simplicity](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Simplicity)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Simplicity](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Simplicity)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Simplicity]Simplicity[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
For lack of better term, Kicksecure is simple. It does not fork or re-compile software packages by upstream projects.
Examples of software where it is often assumed that it is being modified by Kicksecure or being asked in that is the case:
- Does Kicksecure Modify Tor?
- Can Kicksecure Improve Tor?
- Does Kicksecure Change Default Tor Browser Settings?
This has the advantage that questions and issues caused by upstream projects can be redirected upstream as per Free Support Principle. This reduces the maintenance load at Kicksecure project.
Issues which cannot be caused by Kicksecure are sometimes mistakenly attributed to Kicksecure. Examples:
- https://www.mail-archive.com/qubes-users@googlegroups.com/msg29899.html
- https://www.mail-archive.com/qubes-users@googlegroups.com/msg29573.html
- https://forums.whonix.org/t/monero-and-whonix-15-0-1-5-1-bug/10532
Related: Relationship With Upstream
Brevity
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Brevity
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#Brevity|Brevity]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Brevity](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Brevity)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Brevity](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Brevity)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Brevity]Brevity[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
It’s good to be innovative. Such as in case of Kicksecure shipping kloak by default is a win. That threat model has been demonstrated through a proof of concept already. Proactive yes, but in this case of remounting /etc with nosuid the benefit of the change doesn’t have a strong rationale.
In most cases goals should be reached by using 1 implementation. For example to remount /run etc. with more secure mount options an implementation should do this - if possible - either entirely in initramfs or entirely using systemd. It shouldn't do the exact same things twice in initramfs and systemd.
There’s a huge amount of things which users might potentially do which won’t make sense from Kicksecure developers point of view. For example there is the hello package which most users won’t know and won’t install. I am using it as an example here. No need to pick on that particular contributor of that Debian package. Why allow installation of that package? What if that contributor turned evil and somehow included a backdoor in the hello package? To prevent such a backdoor from doing damage, there could be an apt wrapper that prevents installation of that and other packages which most users will probably never need. I am not supposing to invent an apt wrapper for this hypothetical scenario. It would be worse having that code than having that risk.
Feature Removability
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Feature_Removability
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#Feature_Removability|Feature Removability]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Feature Removability](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Feature_Removability)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Feature Removability](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Feature_Removability)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Feature_Removability]Feature Removability[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
In case a feature becomes unmaintainable there needs to be a possiblity to remove the feature for users who use upgrade their system using apt.
Default Application Policy
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Default_Application_Policy
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#Default_Application_Policy|Default Application Policy]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Default Application Policy](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Default_Application_Policy)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Default Application Policy](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Default_Application_Policy)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Default_Application_Policy]Default Application Policy[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
See Default Application Policy.
No Trailing Whitespaces
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#No_Trailing_Whitespaces
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#No_Trailing_Whitespaces|No Trailing Whitespaces]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[No Trailing Whitespaces](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#No_Trailing_Whitespaces)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[No Trailing Whitespaces](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#No_Trailing_Whitespaces)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#No_Trailing_Whitespaces]No Trailing Whitespaces[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Get a decent editor and don’t leave whitespace at the end of lines.
Indentation
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Indentation
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#Indentation|Indentation]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Indentation](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Indentation)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Indentation](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Indentation)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Indentation]Indentation[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Do not use too deep levels of if
and similar.
Bad example:
machine_id() { if ! test -f /etc/machine-id ; then existing_machine_id="$(cat /etc/machine-id)" ## ... fi }
In above example there is need need to put everything under the if
. This is specifically important when there are several levels of conditionals.
Example good:
machine_id() { if ! test -f /etc/machine-id ; then return 0 fi existing_machine_id="$(cat /etc/machine-id)" ## .... }
Shell Scripts
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Shell_Scripts
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#Shell_Scripts|Shell Scripts]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Shell Scripts](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Shell_Scripts)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Shell Scripts](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Shell_Scripts)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Shell_Scripts]Shell Scripts[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
avoid sed awk whenever possible
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#avoid_sed_awk_whenever_possible
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#avoid_sed_awk_whenever_possible|avoid sed awk whenever possible]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[avoid sed awk whenever possible](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#avoid_sed_awk_whenever_possible)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[avoid sed awk whenever possible](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#avoid_sed_awk_whenever_possible)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#avoid_sed_awk_whenever_possible]avoid sed awk whenever possible[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
There might be some older code (before introduction of str_replace) that uses sed / awk. Patches welcome to port to str_replace.
use str_replace whenever possible
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#use_str_replace_whenever_possible
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#use_str_replace_whenever_possible|use str_replace whenever possible]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[use str_replace whenever possible](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#use_str_replace_whenever_possible)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[use str_replace whenever possible](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#use_str_replace_whenever_possible)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#use_str_replace_whenever_possible]use str_replace whenever possible[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
str_replace is installed in Kicksecure / Kicksecure by default. (man page
) [1]
use type -P instead of which
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#use_type_-P_instead_of_which
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#use_type_-P_instead_of_which|use type -P instead of which]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[use type -P instead of which](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#use_type_-P_instead_of_which)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[use type -P instead of which](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#use_type_-P_instead_of_which)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#use_type_-P_instead_of_which]use type -P instead of which[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Please do not use which
. Please use type -P
instead.
https://mywiki.wooledge.org/BashFAQ/081
Proper Whitespace Handling
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Proper_Whitespace_Handling
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#Proper_Whitespace_Handling|Proper Whitespace Handling]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Proper Whitespace Handling](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Proper_Whitespace_Handling)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Proper Whitespace Handling](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Proper_Whitespace_Handling)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#Proper_Whitespace_Handling]Proper Whitespace Handling[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
See Dev/bash.
See Also
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#See_Also
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev%2Fcoding_style#See_Also|See Also]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[See Also](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#See_Also)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[See Also](https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#See_Also)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev%2Fcoding_style?direction=next&oldid=54497#See_Also]See Also[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.


Copy as Wikitext

for Discourse, reddit, GitHub

Copy as Markdown

Copy as phpBB Click below ↴ = Open social URL with share data











We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 12 year success story and maybe DONATE!