Skip to content

Instantly share code, notes, and snippets.

View Starefossen's full-sized avatar
🚀
Building platforms for the Norwegain Government

Hans Kristian Flaatten Starefossen

🚀
Building platforms for the Norwegain Government
View GitHub Profile
@Starefossen
Starefossen / config
Last active December 14, 2015 15:09
SSH config file (~/.ssh/config)
Host <name>
HostName <hostname>
User <username>
IdentityFile "<path>"
@Starefossen
Starefossen / debian-hostname-change.sh
Last active December 14, 2015 15:18
Change hostname
sudo hostname <hostname>
sudo vim /etc/hostname
sudo vim /etc/hosts
string.split(/pattern/)
@Starefossen
Starefossen / multiMatch.js
Created March 7, 2013 15:13
Get all matches form JavaScript Regular Expression
string.match(/pattern/g)
@Starefossen
Starefossen / fish-shell-ubuntu-install.sh
Last active November 12, 2017 14:01
Install Fish shell on Ubuntu 12.04 LTS
# change to root user
su root
# add repository public key to aptitude
wget http://download.opensuse.org/repositories/home:/siteshwar/Ubuntu_12.04/Release.key
apt-key add - < Release.key
rm Release.key
# install fish
echo 'deb http://download.opensuse.org/repositories/home:/siteshwar/Ubuntu_12.04/ /' >> /etc/apt/sources.list.d/osc.list
Quick *nix rootkit check: Write a bash script to try bind() on all ports. If a port is used, but doesn't show in netstat --> usually rootkit
@Starefossen
Starefossen / infib.py
Last active December 14, 2015 18:49
To the infibity and beyond..
from __future__ import division
b = 0
a = 1
i = 2
j = 0
t = (139583862445/1000000)
while(i < 1024):
@Starefossen
Starefossen / parallels-clone-eth0-fix.sh
Last active December 15, 2015 05:49
Parallels clone eth0 fix
sudo vim /etc/udev/rules.d/z25_persistent-net.rules
sudo reboot now
@Starefossen
Starefossen / prlsrvctl-info.sh
Last active December 15, 2015 05:49
Get parallels server info
prlsrvctl info
@Starefossen
Starefossen / php5-pg-install.sh
Last active December 15, 2015 15:59
Install PHP 5 FPG with PostgreSQL support on Ubuntu 12.04 TLS
sudo apt-get install php5-fpm
sudo apt-get install php5-pgsql
sduo service php5-fpm restart