Skip to content

Instantly share code, notes, and snippets.

@rauluranga
rauluranga / nginx.conf
Last active December 14, 2021 00:33
NGINX HTTP/2
# command to generate dhparams.pen
# openssl dhparam -out /etc/nginx/conf.d/dhparams.pem 2048
include /redirects.conf;
server {
listen 80;
listen [::]:80;
access_log off;
@rauluranga
rauluranga / remove_ds_store.sh
Created June 30, 2016 23:22
Recursively Remove .DS_Store
# Open up Terminal
# In the command line, type: cd
# Drag and drop the folder you wish to delete .DS_Store files from, in this case our theme folder. Press enter.
# run:
find . -name '*.DS_Store' -type f -delete.
@rauluranga
rauluranga / move_files.sh
Created June 30, 2016 23:20
script for moving files from subdirs to parent dir
find /TARGET_DIR/* -type d | xargs -n1 sh -c 'echo mv ${0}/* "$( dirname {0})" ";" rm -rvf ${0}' | sh
@rauluranga
rauluranga / vim7.4_with_lua
Created January 21, 2016 18:13 — forked from techgaun/vim8.x_with_lua
Install vim with lua support on ubuntu 15.04
I needed to install vim with lua support because I wanted to use neocomplete in my recently installed 15.04 distro.
The following (based upon https://gist.github.com/jdewit/9818870) should work though I copied it from history:
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install build-essential liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim /usr/bin/vim /usr/local/bin/vim
sudo mkdir /usr/include/lua5.1/include
sudo cp /usr/include/lua5.1/*.h /usr/include/lua5.1/include/
cd /tmp
@rauluranga
rauluranga / cloner
Created January 4, 2016 17:46
clone all repositories from organization
#!/bin/bash
ORG_NAME="YOUR_ORGANIZATIONS_NAME"
ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
GITHUB_INSTANCE="api.github.com"
URL="https://${GITHUB_INSTANCE}/orgs/${ORG_NAME}/repos?access_token=${ACCESS_TOKEN}"
curl ${URL} | ruby -rjson -e 'JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["ssh_url"]} ]}'
@rauluranga
rauluranga / server.bash
Created November 20, 2015 22:57
python HTTP Server
python -m SimpleHTTPServer
@rauluranga
rauluranga / gist:2674d730ae0597ebb246
Last active October 23, 2015 23:03
Recursively Remove .DS_Store Files on Mac OS X
#!/bin/bash
find . -name '*.DS_Store' -type f -delete
@rauluranga
rauluranga / subl
Last active October 14, 2015 21:55
subl command
#!/bin/bash
ln -s /Users/raul/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
@rauluranga
rauluranga / fix_command.sh
Created March 26, 2015 22:18
S3 Error: The difference between the request time and the current time is too large
sudo service ntpd restart
@rauluranga
rauluranga / git-install-ubuntu.sh
Created February 26, 2015 19:21
Install latest version of Git in Ununtu
$ sudo apt-get install python-software-properties
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:git-core/ppa -y
$ sudo apt-get update
$ sudo apt-get install git
$ git --version