Skip to content

Instantly share code, notes, and snippets.

View pgaref's full-sized avatar

Panagiotis (Panos) Garefalakis pgaref

View GitHub Profile
@pgaref
pgaref / gist:4ba7cbd7df64b5e0c13a
Created November 6, 2015 20:02
LXC - Docker "Permission denied - mount failed '/dev/pts/ptmx'->'/dev/ptmx'" FIX for ubuntu
Add line to /etc/apparmor.d/usr.bin.lxc-start fixes issue:
mount options=bind /dev/pts/** -> /dev/**,
And then: sudo service apparmor restart
@pgaref
pgaref / HostName and FQDN change
Last active October 31, 2015 14:44
Change linux hostname and Fully qualified domain name - linux
sudo nano /etc/hostname # For example: db01
sudo nano /etc/hosts # Example: 127.0.0.1 db01.example.com db01
sudo service hostname restart # Restart hostname service
sudo visudo
<username> ALL=NOPASSWD: ALL
@pgaref
pgaref / gist:57c17fc994123540fe62
Created October 19, 2015 20:35
GIT renaming a branch local & remote
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@pgaref
pgaref / gist:3cd7abbf7b1912718e41
Last active October 16, 2015 11:03
Install XCode Command Line tools on OSX
xcode-select --install
# Useful Bash commands
history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
sudo cp play-startup.sh /etc/init.d/
sudo update-rc.d play-startup.sh defaults
sudo update-rc.d -f play-startup.sh remove
@pgaref
pgaref / ubuntu-java7n8
Last active November 9, 2015 19:53
Oracle Java 8 repository for Ubuntu distro
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
## Extra system conf
sudo update-alternatives --config java
sudo update-alternatives --config javac
@pgaref
pgaref / gist:07ab9fa9b6208517a329
Created June 26, 2015 14:53
Kill a bunch of processes by name
for var in $(ps aux | grep ansible | awk '{print $2}'); do echo $var; sudo kill -9 $var; done