Skip to content

Instantly share code, notes, and snippets.

View yashodhank's full-sized avatar
🎯
Manifesting

Yashodhan yashodhank

🎯
Manifesting
View GitHub Profile

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@yashodhank
yashodhank / irctc.js
Last active August 29, 2015 14:25 — forked from shrayasr/irctc.js
IRCTC Tatkal ticket Booking JS helpers
// To be used in conjunction with [Magic Autofill](http://ctrlq.org/irctc/)
/****************************
* TESTED ON CHROME ONLY.
****************************/
// Absolutely required function because of IRCTC's stupid ID naming scheme.
function jq( myid ) {
return "#" + myid.replace( /(:|\.|\[|\]|,)/g, "\\$1" );
}
@yashodhank
yashodhank / add_swap.sh
Last active August 29, 2015 14:28 — forked from koy1619/add_swap.sh
add_swap.sh
#!/bin/bash
#########################################
#Function: add a new swap partition
#Usage: bash add_swap.sh
#Author: Customer service department
#Company: Alibaba Cloud Computing
#Version: 2.1
#########################################
check_os_release()
@yashodhank
yashodhank / mysql_master_slave_monitor.sh
Last active August 29, 2015 14:28 — forked from koy1619/mysql_master_slave_monitor.sh
mysql服务&主从监控脚本 将此脚本放于mysql从库上,设置crontab -e */10 * * * * root /bin/sh /home/mysqld_monitor.sh 每十分钟跑一次,检测到mysqld服务或者是主从宕掉之后会发送邮件(只发一次)!
#!/bin/bash
mysql_status=`netstat -nl | awk 'NR>2{if ($4 ~ /.*:3306/) {print "Yes";exit 0}}'`
PortNum=`netstat -lnt|grep 3306|wc -l`
if [ "$mysql_status" == "Yes" ];then
slave_status=`mysql -uroot -p123456 -e"show slave status\G" | grep "Running" | awk '{if ($2 != "Yes") {print "No";exit 1}}'`
if [ "$slave_status" == "No" ];then
echo "slave is not working!"
[ ! -f "/tmp/slave" ] && echo "Slave is not working!" | mail -s "Warn!MySQL Slave is not working" monitor@test.me
@yashodhank
yashodhank / nixcom.sh
Last active August 29, 2015 14:28
Various linux commands I've found helpful at one time or another
# My preferred ls outputs
ls -Alh --group-directories-first
# Find and remove multiple files with same extension (careful!)
find . -type f -name "*.txt" -exec rm -f {} \;
# You can first view your current default audio device by typing:
pactl stat
# To check the current swappiness value:
#!/bin/sh
# count=4096k -> 4G
sudo dd if=/dev/zero of=/swapfile bs=1024 count=4096k
mkswap /swapfile
swapon /swapfile
chown root:root /swapfile
chmod 0600 /swapfile
sysctl vm.swappiness=10
@yashodhank
yashodhank / install.sh
Last active August 29, 2015 14:28
Perfect Ubuntu 14
#SSD only
sudo vim /etc/fstab
# remove relatime if present and add noatime
#example UUID=3df036c6-8244-49d1-afe4-a3a808e32eeb / ext4 noatime,errors=remount-ro 0 1:x
sudo vim /etc/udev/rules.d/99-ssd.rules
# all non-rotational block devices use 'deadline' scheduler
# mostly useful for SSDs on desktops systems
SUBSYSTEM=="block", ATTR{queue/rotational}=="0", ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/scheduler}="deadline"
@yashodhank
yashodhank / ssc
Created September 24, 2015 02:09 — forked from gretel/ssc
Use 'ssc' (this script) instead of 'ssh' to do your ssh logins. Without a 3rd argument it will list available screens. Given a 3rd argument it will either reattach an existing screen or create a new screen, i.e. 'ssc host.tld session'.
#!/usr/bin/env perl
#
# taken from https://stackoverflow.com/a/1075807/1972627 (Daniel Reeves)
# slightly modified by tom hensel <tom@jitter.eu>
# https://gist.github.com/gretel/c2ef247f51e3cf0c654e
#
# Use 'ssc' (this script) instead of 'ssh' to do your ssh logins.
# Without a 3rd argument it will list available screens.
# Given a 3rd argument it will either reattach an existing screen or create a new screen,
# i.e. 'ssc host.tld session'.
@yashodhank
yashodhank / movetochrome.scpt
Created October 15, 2015 01:59 — forked from diego898/movetochrome.scpt
AppleScript file to move tabs from safari to chrome
tell application "Safari"
if not (exists document 1) then return
set theURL to URL of current tab of window 1
close current tab of window 1
end tell
tell application "Google Chrome"
if not (exists window 1) then
reopen
else