Skip to content

Instantly share code, notes, and snippets.

View vaichidrewar's full-sized avatar

Vaibhav Chidrewar vaichidrewar

  • San Francisco, CA, USA
View GitHub Profile
{
"userConfigMajorVersion": 4,
"userConfigMinorVersion": 0,
"userConfigPatchVersion": 0,
"deviceName": "My UHK",
"doubleTapSwitchLayerTimeout": 250,
"iconsAndLayerTextsBrightness": 255,
"alphanumericSegmentsBrightness": 255,
"keyBacklightBrightness": 255,
"mouseMoveInitialSpeed": 101,
@vaichidrewar
vaichidrewar / unbind_nodegroup
Created October 31, 2013 00:22
Remove the nodegroup or unbound entities bound to nodegroup
> rm service adns_service
ERROR: Cannot delete a service bound to a nodegroup.
> show ns runningConfig | grep nodegroup
add cluster nodegroup gslb_node
bind cluster nodegroup gslb_node
bind cluster nodegroup gslb_node -vServer gslb_vserver
bind cluster nodegroup gslb_node -gslbSite west-coast-site
bind cluster nodegroup gslb_node -service adns_service
>
> unbind cluster nodegroup gslb_node -vserver gslb_vserver
@vaichidrewar
vaichidrewar / apache_installation.sh
Created October 30, 2013 23:48
Apache installation
FreeBSD Install and Configure Apache Web Server
by NIXCRAFT on JUNE 13, 2008 · 7 COMMENTS· LAST UPDATED OCTOBER 8, 2008
in APACHE, FREEBSD, NETWORKING
Q. How do I install and configure Apache web server under FreeBSD 7.x operating systems?
A. FreeBSD comes with various versions of Apache web servers:
=> Apache 1.3
@vaichidrewar
vaichidrewar / gslb_cluster_site_Jaidev_Configuration
Created October 30, 2013 23:19
GSLB Cluster Site Configuration
> show ip
Ipaddress Type Mode Arp Icmp Vserver State Owner
--------- ---- ---- --- ---- ------- ------ -----
1) 10.217.212.19 NetScaler IP Active Enabled Enabled NA Enabled 1
2) 10.217.212.20 NetScaler IP Active Enabled Enabled NA Enabled 2
3) 10.217.212.21 NetScaler IP Active Enabled Enabled NA Enabled 3
4) 10.217.212.22 Cluster IP Active Enabled Enabled NA Enabled Configuration Coordinator
5) 10.217.212.26 MIP Active Enabled Enabled NA Enabled ALL
6) 10.217.212.23 MIP|GSLB Active Enabled Enabled NA Enabled ALL
7) 10.217.212.24 ADNS Active Enabled Enabled NA Enabled ALL
@vaichidrewar
vaichidrewar / system_call.rb
Created October 30, 2013 20:40
System call in ruby Execute system command in ruby
#Getting output of system() calls in ruby
output = `ls`
p output
@vaichidrewar
vaichidrewar / vim_shortcuts
Created October 28, 2013 23:14
Vim shortcuts you google searched for
Go to the start or end of function / Jumping to the start and end of a code block
To jump to the beginning of a C code block (while, switch, if etc), use the [{ command.
To jump to the end of a C code block (while, switch, if etc), use the ]} command.
@vaichidrewar
vaichidrewar / new_gist_file.sh
Created October 27, 2013 23:33
RottenPotatoes Setup and Heroku Deployment You should make git repository first and then only fire 'heroku create' command.
Vaibhavs-MacBook-Pro-2:~ vaibhav$ 169
The authenticity of host 'ec2-54-215-108-91.us-west-1.compute.amazonaws.com (54.215.108.91)' can't be established.
RSA key fingerprint is a6:8b:63:19:e8:f1:01:ac:5b:99:30:03:08:18:fe:50.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-54-215-108-91.us-west-1.compute.amazonaws.com,54.215.108.91' (RSA) to the list of known hosts.
Welcome to Ubuntu 11.10 (GNU/Linux 3.0.0-14-virtual i686)
* Documentation: https://help.ubuntu.com/
@vaichidrewar
vaichidrewar / Array_Operations.rb
Created October 27, 2013 21:49
Ruby String Operations
[12, 47, 35].m­ax
ticket.sor­t!
@vaichidrewar
vaichidrewar / git.
Created October 27, 2013 21:18
Git Basics : git init git status git add octocat.txt git commit -m "Add cute octocat story" git add '*.txt' git commit -m "Add all the octocat txt files" git remote add origin https://github.com/try-git/try_git.git git push -u origin master git pull origin master git diff HEAD git ad octofamily/octodog.txt git diff --staged git reset octfamily/o…
To initialize a Git repository in current directory, type the following command:
git init
Type the git status command to see what the current state of our project is:
git status
Create file octocat.txt in current directory and 'git status' will show it as untracked file.
To tell Git to start tracking changes made to octocat.txt, we first need to add it to the staging area by using git add.
@vaichidrewar
vaichidrewar / exceptions.rb
Created October 27, 2013 01:52
Exceptions in Rails
How to raise an exception
#Objective: If either player's strategy is something other than "R", "P" or "S" (case-insensitive), the method should raise aRockPaperScissors::NoSuchStrategyError exception.
1 class RockPaperScissors
2
3 # Exceptions this class can raise:
4 class NoSuchStrategyError < StandardError ; end <<<<<<<<<<<<<<< This line defines the type of exception
#At appropriate point