Skip to content

Instantly share code, notes, and snippets.

Saulo Silva ssilva

Block or report user

Report or block ssilva

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ssilva / coding-style.rst
Created Sep 4, 2017
Linux kernel coding style
View coding-style.rst

Linux kernel coding style

This is a short document describing the preferred coding style for the linux kernel. Coding style is very personal, and I won't force my views on anybody, but this is what goes for anything that I have to be able to maintain, and I'd prefer it for most other things too. Please at least consider the points made here.



Sum of numbers

Pipe to awk '{s+=$1} END {print s}' or paste -s -d+ - | bc (here paste joins the numbers into one line)


  • { extends the selection until the next empty line


View aws-s3-bucket-policy.json
"Principal": "*",
# Simple, ad-hoc script to quickly bootstrap a fresh Vim install.
echo -n "This will overwrite your .vimrc and plugins. Do you wish to continue [y/N]? "
read answer
if ! echo "$answer" | grep -iq "^y"; then
View .vimrc
execute pathogen#infect()
"execute pathogen#helptags()
" Suggested Pathogen plugins
ssilva / DisableEnableNetworkAdapter.ps1
Created Nov 23, 2012
How to disable & enable a network adapter on Windows with PowerShell
View DisableEnableNetworkAdapter.ps1
# Get the network adapter object
$adapter = Get-WmiObject -Class Win32_NetworkAdapter |
Where-Object {$_.Name -eq "TP-LINK Wireless USB Adapter"}
# Disable it
Write-Host -nonew "Disabling $($adapter.Name)... ";
$result = $adapter.Disable()
if ($result.ReturnValue -eq -0) {
Write-Host "Success.";
} else {
You can’t perform that action at this time.