Skip to content

Instantly share code, notes, and snippets.

View sanguis's full-sized avatar
👁️‍🗨️
DevOpsing all the things

Josh Beauregard sanguis

👁️‍🗨️
DevOpsing all the things
View GitHub Profile
#!/bin/bash
if [ -z $1 ]
then
v=`wget -qO- http://download.virtualbox.org/virtualbox/LATEST.TXT`
else
v=$1
fi
echo "Installing VBoxGuestAdditions version $v."
@sanguis
sanguis / main.yml
Last active April 12, 2016 16:10
zotero ansible play book
---
- name: getting required packages.
apt: name={{ item }}
with_items:
- tar
- firefox
- curl
- name: download application files.
get_url:
dest: /opt/DiTF/opt
##############
## Bash prompt
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
@sanguis
sanguis / split_by_line.bash
Created September 2, 2015 14:36
a quck and dirty script splits a file by line numbers: use input order $file $prefix $linenumbers
#!/bin/bash
mkdir $1
cd $1
split -l $2 ../$0 $1
find . -type f -exec mv '{}' '{}'.csv \;
cd ..
@sanguis
sanguis / find.rb
Last active August 29, 2015 14:19
find example
servers = [
{"release_server"=>
{
"name"=>"foo",
}
},
{"release_server"=>
{
"name"=>"bar",
location = /Content/images/ESG_Logo_280x50.png {
log_not_found off;
access_log off;
error_page 404 =200 /sites/all/themes/foo/logo.png;
}
location / {
error_page 404 index.php
}
@sanguis
sanguis / gist:eb5648b3fcf44b7e09d3
Last active August 29, 2015 13:59
sanguis/Josh beaureards pub key, let me onto your system
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjJAhl1l23ty9oLDhBbYDWBCaWivycC2vEueriluFwD9JrglN4I1W0LJ9HLIp1z07dhCwT1eaeZEp7Xq5gMyN0q//wo4vguBDFggwA1MLA9H/kKUg2sFkZRpIsbUaz4VKQ6tZ5KHrQEbrIYdZ3kxdEAjncMj1HVChOfz2Gy6p1qhGF9jtsBj41Yb2FXG+HV+Sw3kyfaKytHsrgBqY3qhUM0uixqPn2/a6ozW0Uxt+jMrq1wqsOU3OyZHF+MiNAQcfOQvcS2N9Tu3UM+5t1wpiIri/1qEmIjgnkB3F2rOUIw3iNji/aHT90srodwo9b0sZFg87HJkt6GYqCbiw9Mk1h josh.beauregard@knectar.com
@sanguis
sanguis / vhost.conf
Last active August 29, 2015 13:58 — forked from anonymous/nginx.conf
nginx redirecting all non ssl/www traffic to https://www...
server {
listen 443 spdy;
listen 80;
server_name foo.org www.foo.org;
root /home/site/public;
#if ($request_method !~ "^(GET|HEAD|POST)$" ) { return 444; }
if ($https != 'on') { return 301 https://www.foo.org$request_uri; }
if ($host = "foo.org") { return 301 https://www.foo.org$request_uri; }
### Password Protect /administrator area
location ~ /administrator/.* {
auth_basic "Restricted";
auth_basic_user_file /var/www/prod.pac.cr/passwd;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
@sanguis
sanguis / gist:8102272
Created December 23, 2013 18:35
reinstall x
sudo apt-get purge nvidia*
#remove xorg.conf
sudo apt-get --reinstall xserver-xorg-core libgl1-mesa-glx:i386 libgl1-mesa-glx:amd64 libgl1-mesa-dri:i386 libgl1-mesa-dri:amd64
sudo dpkg-reconfigure xserver-xorg
sudo reboot
sudo apt-get install nvidia-current
#if this doesn't work
sudo apt-get install linux-headers-generic-pae