Skip to content

Instantly share code, notes, and snippets.

@sirkkalap
sirkkalap / vim_centos.sh
Last active March 11, 2017 17:00 — forked from fundon/vim_centos.sh
install vim 7.3 on centos, debian, arch etc.
#!/bin/bash
# Install VIM with LUA support on centos minimal (tested 2016-01-21 on CentOS 7)
# source <(curl -sSL https://gist.githubusercontent.com/sirkkalap/1a9d954122039ab6f78f/raw/vim_centos.sh)
# bailout on errors
set -e
sudo yum -y groupinstall 'Development tools'
sudo yum -y install ncurses-devel
sudo yum -y install python python-devel
@sirkkalap
sirkkalap / destroy-CA-ipfw-deny-rules.sh
Created November 26, 2015 08:56
Destroy cisco Any Connect deny rules to use Split Tunneling
#!/bin/sh
# Vagrant generoida privaattiverkot luodessaan ensimmäistä konetta
# Varsinkin Chef kaytossa on kuitenkin tarpeellista olla jo privaverkko
# olemassa ennen ensimmaista konetta (Chef-zero)
# Luodaan siis nama verkot kasin
ifconfig vboxnet0 |grep -q inet
if [ $? != 0 ]; then
VBoxManage hostonlyif remove vboxnet0
@sirkkalap
sirkkalap / run-docker-centos6
Created November 17, 2015 23:32
Run a vanilla centos6 and mount current directory in it as /local
#!/bin/sh
BASEDIR=$(cd $(dirname $0); /bin/pwd)
if [ ! -z $DOCKER_MACHINE_NAME ]; then
ip=$(docker-machine ip $DOCKER_MACHINE_NAME)
docker run -i -t \
--name centos6 \
-v $BASEDIR:/local \
centos:6 \
bash
@sirkkalap
sirkkalap / start-docker-sftp-server
Last active November 17, 2015 23:43
Start up a test sftp-server with docker
#!/bin/sh
# https://gist.github.com/sirkkalap/fe812216be223df310ae#file-start-docker-sftp-server
BASEDIR=$(cd $(dirname $0); /bin/pwd)
if [ ! -z $DOCKER_MACHINE_NAME ]; then
ip=$(docker-machine ip $DOCKER_MACHINE_NAME)
docker run -d \
--name sftp_server \
-v $BASEDIR/share:/home/foo/share \
-p 22222:22 \
@sirkkalap
sirkkalap / docker-machine-solita
Last active November 6, 2015 08:13
Use another cidr suitable for split tunneling
docker-machine create dev --driver virtualbox --virtualbox-hostonly-cidr "192.168.50.1/24"
@sirkkalap
sirkkalap / ssh-agent-init.sh
Last active October 8, 2015 16:04 — forked from im007boy/gist:4079756
ssh-agent
## from https://gist.github.com/sirkkalap/5b1ac4c3619232533dcc
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
eval `$SSHAGENT $SSHAGENTARGS`
trap "kill $SSH_AGENT_PID" 0
ids=$(echo $HOME/.ssh/id* | sed -E "s/ ?[^ ]+\.pub//g")
for id in $ids; do
ssh-add $id
done
ssh-add -l
@sirkkalap
sirkkalap / ssh-agent.sh
Last active October 8, 2015 14:49 — forked from mattbailey/ssh-agent.sh
ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add >/dev/null
/usr/bin/ssh-add $HOME/.ssh/id_rsa
}
@sirkkalap
sirkkalap / fabric8 console output
Created October 1, 2015 19:20
Console output of Fabric8 first run in Vagrant
~/p/f/v/openshift git:master ❯❯❯ vagrant plugin install landrush ⏎
Installing the 'landrush' plugin. This can take a few minutes...
Installed the plugin 'landrush (0.18.0)'!
~/p/f/v/openshift git:master ❯❯❯ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'jimmidyson/centos-7.1' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: = 1.2.1
==> default: Loading metadata for box 'jimmidyson/centos-7.1'
default: URL: https://atlas.hashicorp.com/jimmidyson/centos-7.1
@sirkkalap
sirkkalap / build-env.sh
Created October 1, 2015 17:22
Set up very minimal docker environment to serve demo / development environment for projects
#!/bin/sh
yum update
curl -sSL https://get.docker.com/ | sh
service docker start
# Front reverse proxy with virtual host autoconfiguration
# *** Privileged docker container ***
docker run -d -p 80:80 \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
jwilder/nginx-proxy
#!/bin/sh -e
# Running this script will disable the on-access (real-time) scanner in F-Secure Anti-Virus for Mac
# while preserving the ability to use the on-demand (manual) scanner.
#
# Note that this *will* make the UI persistently tell you that there is a problem with real-time
# scanning. Which is true, because you disabled it. :-)
#
# NOTE THAT THIS WILL MAKE YOUR COMPUTER UNPROTECTED. DO THIS AT YOUR OWN RISK!
# NOTE THAT THIS WILL MAKE A BACKUP COPY IN YOUR "Documents" FOLDER. KEEP IT.
# NOTE THAT THIS IS AN UNSUPPORTED HACK. IT MAY STOP WORKING AT ANY TIME.