Skip to content

Instantly share code, notes, and snippets.

View Starefossen's full-sized avatar
🍉
Developer experience in the Norwegain Government

Hans Kristian Flaatten Starefossen

🍉
Developer experience in the Norwegain Government
View GitHub Profile
@Starefossen
Starefossen / Vagrantfile
Last active December 18, 2015 16:38
Vagrant (precise32) configuration for php5-fpm and nginx. Simply place these files in any directory and run __vagrant up__.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.provision :shell, :path => "bootstrap.sh"
config.vm.network :forwarded_port, guest: 80, host: 8080
end
@Starefossen
Starefossen / connections.sh
Created June 19, 2013 08:04
list connections
netstat -tap
@Starefossen
Starefossen / find-replace.sh
Created June 19, 2013 08:08
find / replace file
sed -i ‘s/[orginal_text]/[new_text]/’ filename.txt
@Starefossen
Starefossen / vim-copy-paste.sh
Created June 19, 2013 08:09
vim copy / paste auto indent
:set paste # disables autoindent
:set nopaste # enables autoindent
@Starefossen
Starefossen / cmd-count-lines.sh
Created June 19, 2013 09:17
count lines from command output
cmd | wc -l
@Starefossen
Starefossen / tmux-cheats.md
Last active August 25, 2025 12:39
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@Starefossen
Starefossen / vim-cheats.md
Last active August 11, 2025 02:43
My vim cheat sheet for working with tabs and window splits.

Tabs

New Tab

  • :tabnew - new blank tab
  • :tabedit [file] - open file in tab

Cursor Movement

  • gt (:tabn) - next tab
@Starefossen
Starefossen / git-ignore-modified
Created September 13, 2013 08:30
Ignore modified file in git
git update-index --assume-unchanged path/to/file
@Starefossen
Starefossen / gist:6699580
Last active June 22, 2022 12:37
Command line HTTP POST with custom headers and JSON payload using CURL
curl -X POST \
-H "X-Parse-Application-Id: $APP_ID" \
-H "X-Parse-REST-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{"score": 1337, "playerName": "Sean Plott", "cheatMode": false }' \
https://api.parse.com/1/classes/GameScore
@Starefossen
Starefossen / gist:6724397
Created September 27, 2013 05:04
Find process listening on port 80
netstat -tulpn | grep :80