Skip to content

Instantly share code, notes, and snippets.

View techgaun's full-sized avatar
🌌
Enum.random(["code", "sleep", "eat", "fifa", "soccer", "guitar", "board games"])

Samar Dhwoj Acharya techgaun

🌌
Enum.random(["code", "sleep", "eat", "fifa", "soccer", "guitar", "board games"])
View GitHub Profile
@techgaun
techgaun / sysctl.conf
Created February 24, 2015 13:36
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
language: c
env:
global:
- "HOST_IP=$(/sbin/ifconfig venet0:0 | grep 'inet addr' | awk -F: '{print $2}' | awk '{print $1}')"
- DOCKER_HOST=tcp://$HOST_IP:2375
- DOCKER_PORT_RANGE=2400:2500
- SLIRP_PORTS=$(seq 2375 2500)
before_install:
@techgaun
techgaun / node-modules-sec-check.sh
Created December 9, 2014 12:25
Check security vulnerabilities of node module you are using
#!/bin/bash
#go inside your node_modules folder and run this script
for module in *;
do
version=$(grep '"version":' $module/package.json | cut -d"\"" -f4);
echo "testing $module-v$version";
curl "https://nodesecurity.io/validate/$module/$version";
echo "";
done
@techgaun
techgaun / mailsend-install-amazon-linux.sh
Created November 28, 2014 11:08
Install mailsend on centos, rhel, amazon linux
#!/bin/bash
#installs https://github.com/muquit/mailsend
#tested on amzn linux
git clone git@github.com:muquit/mailsend.git mailsend
cd mailsend
git checkout 1.17b14
yum install -y openssl-devel
./configure --with-openssl=/usr/
make && make install
@techgaun
techgaun / prepare-commit-msg
Created November 13, 2014 20:47
Prepare-commit-msg hook for github + Pivotal Tracker Integration
#!/usr/bin/env node
/*
* Author: Samar Acharya <samar@techgaun.com>
* Place it in .git/hooks and chmod +x .git/hooks/prepare-commit-msg
* Based on http://www.ipreferjim.com/2013/04/git-prepare-commit-msg-with-node-js/
*/
var exec = require('child_process').exec,
util = require('util'),
@techgaun
techgaun / graphicmagick-amzn-linux
Created November 13, 2014 20:02
Install GraphicMagick in Amazon Linux
#!/bin/bash
yum install -y gcc libpng libjpeg libpng-devel libjpeg-devel ghostscript libtiff libtiff-devel freetype freetype-devel
wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/GraphicsMagick-1.3.20.tar.gz
tar xfz ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/GraphicsMagick-1.3.20.tar.gz
cd GraphicsMagick-1.3.20
./configure
make
make install
@techgaun
techgaun / git-tips.md
Last active August 29, 2015 14:09
Collection of miscellanous git tips

Collection of miscellanous git tips

Get current branch

git rev-parse --abbrev-ref HEAD
git symbolic-ref --short HEAD #probably works for 1.8 and newer clients
@techgaun
techgaun / markdown-cmdline.md
Created October 29, 2014 16:20
markdown viewer in command line

Markdown Viewer in your terminal

  • markdown
apt-get install markdown lynx
markdown <markdown_file> | lynx -stdin
  • pandoc
@techgaun
techgaun / virsh-set-guest-memory
Created October 29, 2014 15:08
virsh set memory for guest
virsh setmem guest-name <new-memory-in-KB>
@techgaun
techgaun / tar-extract-particular-file
Created October 29, 2014 15:04
extract particular file using tar
tar -xvf file.tar.gz --wildcards --no-anchored "<file_name>" -C /home/samar/path/to/extract/