Skip to content

Instantly share code, notes, and snippets.


Kapil Viren Ahuja kvahuja

View GitHub Profile
kvahuja / setup-user.MD
Last active Nov 27, 2017
Ubuntu Management - Server Setups
View setup-user.MD

User Setup

Add a User

Run the following command to add a new user on a system.

sudo adduser <username>
kvahuja / Items.php
Created Mar 4, 2017
Vainglory Items
View Items.php
return [
'*1000_Item_HalcyonPotion*' => 'halcyon-potion',
'Mulled Wine' => 'halcyon-potion',
'*1002_Item_WeaponBlade*' => 'weapon-blade',
'Weapon Blade' => 'weapon-blade',
'*1003_Item_CrystalBit*' => 'crystal-bit',
'Crystal1' => 'crystal-bit',
kvahuja / Heros.php
Last active Apr 1, 2017
Vainglory API - Mappings
View Heros.php
return [
'*Adagio*' => 'Adagio',
'*Alpha*' => 'Alpha',
'*Ardan*' => 'Ardan',
'*Baron*' => 'Baron',
'*Blackfeather*' => 'Blackfeather',
'*Catherine*' => 'Catherine',
View db-connect-check.php
# To run this script use the following command on cli (we assume you have all dependencies installed)
# only checks for mysql for now
# $ php -f db-connect-check.php
$dbhost = 'host';
$dbport = '3306'
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
kvahuja / Info.php
Created Feb 27, 2017
Check PHP Installation
View Info.php
kvahuja /
Created Feb 10, 2017
PgSQL Commands
# how to generate a dump for postgres
pg_dump --file "dmp.filename.ext" --host "hostname" --port "5432" --username "myusername" --password "changeme" --verbose --role "dbname" --format=c
kvahuja /
Last active Feb 7, 2017
Shell Cheat Sheet
scp -i folder/where/private/key/is/placed/key-name.ppk -r source/folder/in/local.machine/* username@host:/folder/in/remote/machine/
View Spring Profiling Aspect Sample
public class ProfilingAspect {
public Object profile(ProceedingJoinPoint pjp) throws Throwable {
StopWatch sw = new StopWatch(getClass().getSimpleName());
try {
return pjp.proceed();
} finally {
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
You can’t perform that action at this time.