Skip to content

Instantly share code, notes, and snippets.

Amit Bakshi ambakshi

Block or report user

Report or block ambakshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ambakshi
ambakshi / gcccpuopt.sh
Last active Aug 22, 2018
Determine set of best gcc optimization flags for the current host.
View gcccpuopt.sh
#!/bin/sh
# Print the gcc cpu specific options tailored for the current CPU
# Author:
# http://www.pixelbeat.org/
# Notes:
# This script currently supports Linux,FreeBSD,Cygwin
# This script is x86 (32 bit) specific
# It should work on any gcc >= 2.95 at least
@ambakshi
ambakshi / osx-fix-home-and-end-keys.sh
Created Feb 20, 2018
Fixes the osx home/end keys so they work the way they do on Linux/Windows.
View osx-fix-home-and-end-keys.sh
#!/bin/sh
mkdir -p ~/Library/KeyBindings
cd ~/Library/KeyBindings
if test -e DefaultKeyBinding.dict; then
echo >&2 "WARNING: Skipping customizing key bindings. $(pwd)/DefaultKeyBinding.dict already exists"
exit 0
fi
cat > DefaultKeyBinding.dict <<'EOF'
{
@ambakshi
ambakshi / storeid_rpmdeb.go
Last active May 9, 2018
Simple store_id_program for squid. Build it, put it into /usr/lib64/squid/, and add "store_id_program /usr/lib64/squid/storeid_rpmdeb" to your squid.conf
View storeid_rpmdeb.go
package main
import (
"bufio"
"fmt"
"os"
"regexp"
"strings"
)
@ambakshi
ambakshi / letsencrypt.sh
Last active May 15, 2017
Obtain LE certs for multiple SANs
View letsencrypt.sh
#!/bin/bash
#
# Get LetsEncrypt SSL certs
#
# Usage:
# letsencrypt.sh host1.domain.com host2.domain.com ...
#
# You must have your git config user.email set correctly
#
# The way this script works is that you register a wildcard DNS
@ambakshi
ambakshi / g++-5.sh
Created Apr 1, 2016
Install g++ 5.x on Ubuntu Trusty (14.04)
View g++-5.sh
#!/bin/bash
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y g++-5 gcc-5
@ambakshi
ambakshi / xcabakshimbp.pub
Created Apr 1, 2016
abakshi@xcabakshimbp.local
View xcabakshimbp.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDeFQ/NE6ZgqhUaj+lyc5jbEJkkwWjDxSddXOhFDs5e4Mni06m+vrI4rNoZ4mdP3l2p2rECBgPjE59SYbswUlzJWKhdBWLK0BH+rKn5fXjH/2VbE4YrVJaHONjhsLqLNKfvD7C5CC6T7hcwafwNwDjVblmXr/VydIhETnLnwnRZTXA0fTvd/W15gwpMQ+XY/cpTLaAH00oX26nfZRJCdKcVnPIa+OwBD3t2R3tzGdsevvprVCg80Tmyy6LYqLF4dLZVYz/o8G1QNgyjmvhIxyEYFQscT9LL70qfKz/UAUQTdiYr8Z73OXAzDXqNN46PvHSm35W3kQzizsd4KQWEom8J abakshi@xcabakshimbp.local
@ambakshi
ambakshi / debian-jdk8-install.sh
Last active May 27, 2016
Install Oracle JDK 8 on a Debian based system.
View debian-jdk8-install.sh
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install -yq software-properties-common apt-utils
add-apt-repository ppa:webupd8team/java -y && apt-get update && \
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886 && \
apt-get install -y --no-install-recommends oracle-java8-installer
@ambakshi
ambakshi / bootstrap-p4p.sh
Last active Nov 12, 2015
bootstrap-p4p.sh
View bootstrap-p4p.sh
#!/bin/bash
#
# GCE startup script for a Perforce Proxy. Set the metadata keys to
# env-vars you'd like to set (for example, P4PORT=xyz:1666)
#
# Amit Bakshi
# 11/11/2015
set -ex
@ambakshi
ambakshi / cloud-init.sh
Last active Dec 6, 2017
Amazon Linux cloud-init script
View cloud-init.sh
#!/bin/bash
#
# Amazon Linux cloud-init script
#
# Amit Bakshi
# 10/2014
#
if [ `id -u` -ne 0 ]; then
sudo exec /bin/bash -x "$0" "$@"
fi
@ambakshi
ambakshi / vimrc
Last active Nov 13, 2015
vimrc minimal
View vimrc
" barebones https://gist.github.com/ambakshi/a0c226496e84f924ac2f/raw/vimrc
set nocompatible
set backspace=indent,eol,start
syntax on
filetype plugin indent on
set hidden
nnoremap ; :
" bonus settings
set smartcase
set incsearch
You can’t perform that action at this time.