Skip to content

Instantly share code, notes, and snippets.

View forAllBright's full-sized avatar
:octocat:
Focusing

forAllBright forAllBright

:octocat:
Focusing
View GitHub Profile
@Lh4cKg
Lh4cKg / kill python processes
Last active December 7, 2018 12:29
kill all python process
[innotec@innotec ~]$ ps aux | grep 'manage.py' | awk '{print $2}' | xargs kill -9
# add alias in .bashrc
# kill python processes
alias ppsk="pkill -f manage.py"
# or
[innotec@innotec ~]$ killall python
# or
alias pk="ps aux | grep 'manage.py' | awk '{print $2}' | xargs kill -9"
@oleksii-zavrazhnyi
oleksii-zavrazhnyi / gist:968e5ea87e99d9c41782
Created November 28, 2014 17:32
BASH Absolute path of current script
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

Is a useful one-liner which will give you the full directory name of the script no matter where it is being called from

These will work as long as the last component of the path used to find the script is not a symlink (directory links are OK). If you want to also resolve any links to the script itself, you need a multi-line solution:

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
@mslinn
mslinn / decompile.bat
Last active March 19, 2024 17:07
Decompile JVM class files using IntelliJ IDEA's embedded FernFlower decompiler
java -cp "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true . src
@ccstone
ccstone / References For Learning & Using Applescript.md
Last active May 10, 2024 15:40
References For Learning & Using Applescript

REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47


NOTES

AppleScript is a rather peculiar scripting language to learn.

@eguven
eguven / brew-list.sh
Last active May 17, 2024 13:06
List all packages installed using Homebrew and their sizes
# this original one uses values returned from 'brew info'
brew list --formula | xargs -n1 -P8 -I {} \
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \
sort -h -r -k2 - | column -t
# faster alternative using 'du'
du -sch $(brew --cellar)/*/* | sed "s|$(brew --cellar)/\([^/]*\)/.*|\1|" | sort -k1h