Skip to content

Instantly share code, notes, and snippets.

View sarveshseri's full-sized avatar

Sarvesh Kumar Singh sarveshseri

View GitHub Profile
package controllers.auth
import play.api._
import play.api.mvc._
import play.api.data._
import views._
object AuthController extends Controller {
# **************** READ THIS FIRST ******************
#
# This is not a script for you to run. I repeat, do not download and run this!
#
# This is only a guide to show the required steps for successful UEFI + GRUB2 installation
# Many of the choices are examples or assumptions; don't blindly type shit into your machine
# until/unless you at least read the comments around each command
#
# These steps assume you've booted in UEFI mode by preparing your USB stick per these instructions:
# https://wiki.archlinux.org/index.php/UEFI#Archiso
@sarveshseri
sarveshseri / Arch Auto mont for USB disks
Created January 7, 2014 06:12
Automount for external usb disks for light DM's like xfce.. http://kissmyarch.blogspot.in/2011/10/usb-automount.html
vim /etc/udev/rules.d/10-my-media-automount.rules
# vim:enc=utf-8:nu:ai:si:et:ts=4:sw=4:ft=udevrules:
#
# /etc/udev/rules.d/10-my-media-automount.rules
# start at sdb to ignore the system hard drive
KERNEL!="sd[b-z]*", GOTO="my_media_automount_end"
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="my_media_automount_end"

Arch Gnome

Remove all xfce4
sudo su -
pacman -Sg xfce4 xfce4-goodies | awk '{print $2}' | xargs pacman -R --noconfirm libxfce4ui libxfcegui4

Network Manager

Arch KDE

Remove all xfce4
sudo su -
pacman -Sg xfce4 xfce4-goodies | awk '{print $2}' | xargs pacman -R --noconfirm libxfce4ui libxfcegui4
Install KDE

tl;dr

  1. Don't run as root.
  2. For sessions, set httpOnly (and secure to true if running over SSL) when setting cookies.
  3. Use the Helmet for secure headers: https://github.com/evilpacket/helmet
  4. Enable csrf for preventing Cross-Site Request Forgery: http://expressjs.com/api.html#csrf
  5. Don't use the deprecated bodyParser() and only use multipart explicitly. To avoid multiparts vulnerability to 'temp file' bloat, use the defer property and pipe() the multipart upload stream to the intended destination.

Install Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Setup zsh

Install zsh
$ brew install zsh
oh-my-zsh
@sarveshseri
sarveshseri / ec2-ubuntu-prepare.md
Last active October 23, 2015 08:37
Prepare ec2 instances
Initial upgrade
sudo apt-get update
sudo apt-get -y upgrade
Install essentials
sudo apt-get install -y build-essential
sudo apt-get install -y git