Skip to content

Instantly share code, notes, and snippets.

View vireshas's full-sized avatar
:octocat:

Viresh Sanagoudar vireshas

:octocat:
View GitHub Profile
@vireshas
vireshas / replier.rb
Last active October 27, 2023 15:59
Facebook birthday replier
#!/usr/bin/env ruby
# Usage:
# replier.rb <pass access token here>
# access_token="your access token goes here" replier.rb
#
# If your access_token is expired, you can get a 400 bad request exception. Go get a fresh access_token in that case.
require 'rest-client'
require 'json'
require 'time'
@vireshas
vireshas / split_wav.py
Created November 16, 2017 12:16 — forked from rudolfbyker/split_wav.py
Split WAV files at silence
#!/usr/bin/env python
from scipy.io import wavfile
import os
import numpy as np
import argparse
from tqdm import tqdm
# Utility functions
@vireshas
vireshas / binaries download
Created August 26, 2016 10:06
Download binaries from github
First, to get a list of the assets for the latest release:
curl -H "Authorization: token YOURGITHUBTOKEN" https://api.github.com/repos/NAME/REPO/releases/latest
Then in the JSON, look up the url of the asset you want. For example it would look like: "url": "https://api.github.com/repos/NAME/REPO/releases/assets/1275759"
Then you pass this to another curl command to retrieve the actual URL, which is actually a link to an Amazon S3 file.
curl -H "Authorization: token YOURGITHUBTOKEN" -H "Accept:application/octet-stream" -i https://api.github.com/repos/NAME/REPO/releases/assets/1275759
The URL will be in the "location" field of the HTTP response, and then use curl to get the file like this:
@vireshas
vireshas / hgetall.go
Created October 28, 2014 09:36
hgetall from go using redigo
values, err := redis.String(c.Do("HGETALL", queue_id, "result"))
if err != nil {
fmt.Println("HGETALL", err)
}
for i := 0; i < len(values); i += 2 {
key, _ := redis.String(values[i], nil)
value, _ := redis.String(values[i+1], nil)
fmt.Println(" %s: %s", key, value)
@vireshas
vireshas / main.go
Created December 31, 2019 07:49 — forked from superbrothers/main.go
http request with context in Go
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
)
@vireshas
vireshas / main.go
Created June 3, 2019 09:45 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@vireshas
vireshas / go-ssh-reverse-tunnel.go
Created May 20, 2019 04:35 — forked from codref/go-ssh-reverse-tunnel.go
Go SSH reverse tunnel implementation (SSH -R)
/*
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command:
ssh -R 8080:127.0.0.1:8080 operatore@146.148.22.123
which opens a tunnel between the two endpoints and permit to exchange information on this direction:
server:8080 -----> client:8080
@vireshas
vireshas / ssh
Created May 20, 2019 04:35 — forked from zxvdr/ssh
SSH proxy
package main
import (
"bytes"
"code.google.com/p/go.crypto/ssh"
"fmt"
"log"
"net"
"os"
)
@vireshas
vireshas / raft.go
Created May 6, 2019 05:30 — forked from F21/raft.go
Sample hashicorp/raft + hashicorp/serf app
package main
import (
"crypto/md5"
"flag"
"fmt"
"io"
"log"
"os"
"path/filepath"

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?