Skip to content

Instantly share code, notes, and snippets.

View meain's full-sized avatar

Abin Simon meain

View GitHub Profile
package main
import (
"log"
"net/smtp"
)
func main() {
send("hello there")
}
@meain
meain / loading_messages.js
Last active April 12, 2025 00:24
Funny loading messages
export default [
"Reticulating splines...",
"Generating witty dialog...",
"Swapping time and space...",
"Spinning violently around the y-axis...",
"Tokenizing real life...",
"Bending the spoon...",
"Filtering morale...",
"Don't think of purple hippos...",
"We need a new fuse...",
@meain
meain / chat_client.py
Created November 19, 2017 16:19
NOS Lab
import socket, select, sys
host = "localhost"
port = 9009
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((host, port))
while 1:
read, write, error = select.select([sock, sys.stdin], [], [])
@meain
meain / _readme.md
Created November 8, 2017 17:20 — forked from hew/_readme.md
Operator Mono w/ Italics on OSX VIm

Operator Mono w/ Italics on OSX Vim

@meain
meain / irctc.py
Created September 30, 2017 15:45 — forked from avamsi/irctc.py
Python script to semi-automate tatkal ticket booking.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select, WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep, strftime
def waituntil(s):
while strftime('%H:%M:%S') < s:
print strftime('%H:%M:%S')
sleep(1)
@meain
meain / cmd.sh
Created June 30, 2017 05:46 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@meain
meain / ncserver.py
Last active February 28, 2017 06:22
A tiny echo server python
# connect to it using netcat or telnet (nc <ip address> <port>)
import socket
import sys
import threading
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #create socket
s.bind(("0.0.0.0",55555)) #binding port
s.listen(1) #listening for only one client
print "Yo kido! We are rolling."
@meain
meain / pre-commit
Last active November 22, 2021 05:18
Check for curse words ( used as git pre-commit hook )
# to use this use
# mv pre-commit .git/hooks/pre-commit
# chmod +x .git/hooks/pre-commit
function check_sanity(){
git diff | grep -i 'fuck\|shit\|crap\|dammit\|bitch\|asshole\|shithead'|wc -m
}
function print_insanity(){
git diff | grep -i 'fuck\|shit\|crap\|dammit\|bitch\|asshole\|shithead'
}
@meain
meain / whatasppSpam.js
Last active June 9, 2017 17:15
Whatsapp web spam script
// for send function to select input
function dispatch(target, eventType, char) {
var evt = document.createEvent("TextEvent");
evt.initTextEvent (eventType, true, true, window, char, 0, "en-US");
target.focus();
target.dispatchEvent(evt);
}
// enters input and clicks button
function send(msg){