Skip to content

Instantly share code, notes, and snippets.

View saxenap's full-sized avatar

Praveen Saxena saxenap

  • West Lafayette, IN
View GitHub Profile
find /var/log/ -name "*_log-*" -mtime +1 -exec rm -f {} \;
@saxenap
saxenap / SSH Setup
Created February 20, 2016 04:39
SSH Setup
ssh-keygen
(Enter: ~/.ssh/bitbucket_rsa)
ps -e | grep [s]sh-agent
ssh-agent /bin/bash
ssh-add ~/.ssh/bitbucket_rsa
ssh-add -l
cat ~/.ssh/bitbucket_rsa.pub
@saxenap
saxenap / install node
Created March 10, 2016 17:00 — forked from guybrush/install node
install multiple nodejs versions, use same npm packages
#
# node ---------------> ~/.nvm/<node-version>/bin/node
# node-libraries -----> ~/.node_libraries
# node-binaries ------> ~/.node_binaries
#
aptitude install g++ curl libssl-dev apache2-utils make
git clone git://github.com/creationix/nvm.git ~/.nvm
vi ~/.bashrc
export PATH=$PATH:~/.node_binaries
NVM_DIR=$HOME/.nvm
return function(n, a, b) {
return n > 0 ? arguments.callee(n - 1, b, a + b) : a;
}(n, 0, 1);
@saxenap
saxenap / Makefile
Last active April 10, 2016 22:27 — forked from avalanche123/Makefile
new PHP project Makefile
AUTHOR = AUTHOR
EMAIL = EMAIL
PROJECT = PROJECT
PROJECTNAMESPACE = PROJECTNAMESPACE
BUILDFILE = $(PROJECT).phar
SRCDIR = src
TESTDIR = tests
PHPUNITCONFIG = phpunit.xml.dist
BOOTSTRAP = bootstrap.php
PHPUNIT = vendor/bin/phpunit
sudo yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel \
libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
sudo yum install ruby-devel
rm -rf install-nodejs && wget -O install-nodejs https://gist.githubusercontent.com/saxenap/a11c32c94b66319047d4/raw && chmod 777 install-nodejs && ./install-nodejs
gem install io-console
gem install middleman
@saxenap
saxenap / README.md
Created March 24, 2016 10:40 — forked from nodesocket/README.md
The perfect Gulp.js

The perfect gulp.js file

Tasks

serve

Runs a connect web server, serving files from /client on port 3000.

uglify-js

@saxenap
saxenap / Gulpfile
Created March 24, 2016 10:43 — forked from davidnknight/Gulpfile
A well structured gulpfile that performs CSS, JS, image and PHP tasks with an abstract config.
Specifically, this gruntfile will perform the following.
- CSS:
-- Compile SCSS
-- Add vendor prefixes for the last 10 browser versions
- JS:
-- Run scripts through jshint to detect errors and potential problems in code.
-- Compile scripts to your destination folder in their original state. Use these in development environments as they'll be easier to debug with as their code doesn't exist on 1 line, nor is it obfuscated.
-- Minify and concatenate scripts into one all.min.js. Uglify will also obfuscate code if you set mangle to true, leave as false if using AngularJS.
<VirtualHost *:80>
UseCanonicalName Off
ServerAlias *
VirtualDocumentRoot "/var/www/sites-available/%0/public"
Options +Includes
</VirtualHost>
@saxenap
saxenap / Makefile
Last active April 30, 2016 23:37
Makefile to install (very insecure) development WordPress
# rm -rf Makefile && wget -O Makefile https://gist.githubusercontent.com/saxenap/e4b65f41fb6ebb5185e8fff06974f8a6/raw
ROOT_DIR :=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
USER = USER
PASSW = PASSWORD
TITLE ?= test_site
USER_EMAIL ?= test@test.com
URL ?= $(shell curl http://169.254.169.254/latest/meta-data/public-ipv4)