Skip to content

Instantly share code, notes, and snippets.

@ricalo
ricalo / listtemp.sh
Last active December 8, 2018 11:28
List temperature of all disk drives in FreeNAS
ls /dev/ada? | xargs -tL 1 sudo smartctl -a | grep Temperature_Celsius
@ricalo
ricalo / gist:b880a6ee93c1bc66bf6ebf953848ea67
Last active March 8, 2018 01:13
Run gnome-terminal from Windows Subsystem for Linux
export DISPLAY=:0
export NO_AT_BRIDGE=1
gnome-terminal
@ricalo
ricalo / print_hex_chars.sh
Last active October 4, 2017 03:41
Print groups of 8 chars from a text file, used this to validate that my files end with a NEWLINE char.
xxd -c 8 test.txt
@ricalo
ricalo / tags.sh
Created April 11, 2017 03:10
Generate tags for You Complete Me
ctags --recurse --fields=+l
@ricalo
ricalo / symlink.sh
Created February 8, 2017 22:17
Update symlink
@ricalo
ricalo / delete.bat
Created December 31, 2016 17:07
Delete stubborn files on Windows
chkdsk /f
takeown /f *.* /r /a /d y
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@ricalo
ricalo / updateTree.sh
Last active April 20, 2017 04:58
Update file permissions in Git. Useful when you have to upload scripts to your CI/CD
// source: http://stackoverflow.com/questions/10516201/updating-file-permissions-only-in-git
git ls-tree HEAD
git update-index --chmod=+x script.sh
git commit
git checkout script.sh
@ricalo
ricalo / todofix.sql
Created August 17, 2016 04:57
BigQuery - Get all todo: fix comments
SELECT
SUM(copies)
FROM
[bigquery-public-data:github_repos.contents]
WHERE
NOT binary
AND lower(content) CONTAINS 'todo: fix'
@ricalo
ricalo / VinoDoNotRequireEncryption.sh
Created June 21, 2016 22:17
Vino (VNC), do not require encryption
gsettings set org.gnome.Vino require-encryption false
/usr/lib/vino/vino-server &