Skip to content

Instantly share code, notes, and snippets.

@ricalo
ricalo / .bashrc
Last active April 30, 2024 15:15
Use git-bash from Android Studio terminal
if [ ! -z "${IDE}" -a "${IDE}" == "AndroidStudio" ]; then
cd $OLDPWD;
fi
@ricalo
ricalo / reset.sh
Created March 2, 2016 17:48
Ubuntu no sound after restart
pulseaudio -k && sudo alsa force-reload
@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 / 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 / tags.sh
Created April 11, 2017 03:10
Generate tags for You Complete Me
ctags --recurse --fields=+l
@ricalo
ricalo / emulator.md
Last active March 10, 2017 00:06
Start android emulator with virtualization on Linux

Linux with KVM and Google DNSs

 ~/Android/Sdk/tools/emulator -netdelay none -netspeed full -avd Nexus_5_API_24 -qemu -enable-kvm -dns-servers 8.8.8.8,8.8.4.4 &

AOSP build

emulator -skindir ~/Android/Sdk/skins -skin nexus_5x
@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