Skip to content

Instantly share code, notes, and snippets.

View akora's full-sized avatar

Andras Kora akora

View GitHub Profile
@akora
akora / two-line-prompt-mac-cli.sh
Last active August 29, 2015 14:15
Two-line prompt for Mac OS X command line, for long paths. Tested in iTerm2.
# previous one line version
# PS1='\[\e[44;36m\][\u@\h \w] $\[\e[0m\] '
color_blue="\[\e[44;36m\]"
path_short="\w"
color_reset="\[\e[0m\]"
new_line="\n"
PS1="$color_blue$path_short$color_reset$new_line[\u@\h] $ "
@akora
akora / turn-off-IPv6-on-debian
Created February 16, 2015 04:08
Turn off IPv6 on Debian. Edit /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1
@akora
akora / static-IP-on-debian
Last active August 29, 2015 14:15
Set up static IP address on Debian. Edit /etc/network/interfaces
auto lo
iface lo inet loopback
# IPv4 address
iface eth0 inet static
address 192.168.xxx.xxx
netmask 255.255.255.0
network 192.168.xxx.0
broadcast 192.168.1.255
gateway 192.168.xxx.1
@akora
akora / install-flash-plugin-on-debian7-kde.sh
Created February 16, 2015 18:10
Install Flash plugin (for Chrome) on Debian 7 KDE
sudo echo "deb http://ftp.dk.debian.org/debian wheezy-backports main contrib" >> /etc/apt/sources.list
sudo apt-get update
sudo aptitude -t wheezy-backports install pepperflashplugin-nonfree
@akora
akora / mac-os-git-aware-bash-prompt.sh
Created February 22, 2015 16:57
Mac OS Yosemite Git aware (two-line) bash prompt
# settings for the main prompt
BLUE="\[\e[44;36m\]"
PATH_SHORT="\w"
COLOR_RESET="\[\e[0m\]"
NEW_LINE="\n"
# RAG colors indicating git status
RED="\[\033[0;31m\]"
AMBER="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
@akora
akora / remove-formatting-clipboard-content-yosemite
Last active August 29, 2015 14:15
Remove formatting of clipboard content (turning it into plain text) when copy-pasting - Mac OS Yosemite
Open 'System Preferences'
Select 'Keyboard'
Select tab 'Shortcuts'
Select 'App Shortcuts' from the left listbox
Click '+' below right listbox
Select 'All Applications' for 'Application' input box
Type 'Paste and Match Style' into the 'Menu Title' input box
@akora
akora / capture-windows-without-shadows-mac-os.sh
Created March 17, 2015 22:14
Capture windows on Mac OS X as JPEGs without shadows
screencapture -ow ~/Documents/<subdirectory>/<name-of-the-file>.jpg
# -o in window capture mode, do not capture the shadow of the window
# -w only allow window selection mode
@akora
akora / set-default-ical-time-zones-mac-os.sh
Created April 18, 2015 16:54
Set default time zones in iCal in Yosemite
# read the current settings
defaults read com.apple.iCal 'RecentlyUsedTimeZones'
#set new defaults
defaults write com.apple.iCal 'RecentlyUsedTimeZones' '("America/New_York", "Europe/Budapest", "Europe/London")'
@akora
akora / virtualbox-shared-folder-on-debian
Last active January 4, 2016 19:29
Debian 7 VirtualBox shared folder setup in /etc/fstab
<SharedFolderName-on-host-OS> /home/<username>/shared vboxsf defaults,rw,uid=1000,gid=1000 0 0
@akora
akora / disable-iPhoto-face-recognition.sh
Last active January 12, 2017 10:57
Disable iPhoto's face recognition on Mac OS X Yosemite. Run from command line.
defaults write com.apple.iPhoto PKFaceDetectionEnabled 0
# then right click your PhotoLibrary in Finder (in your Pictures folder) and remove the following files:
# Faces.db (in Pictures/iPhoto Library/Database/apdb)
# Faces folder (in Pictures/iPhoto Library/Database)