Skip to content

Instantly share code, notes, and snippets.

View qzaidi's full-sized avatar
💭
smiling

Qasim Zaidi qzaidi

💭
smiling
View GitHub Profile
@zenglian
zenglian / cisco-anyconnect-auto-login.md
Last active February 6, 2024 13:28
auto login with cisco anyconnect (password saved, silent mode)

Cisco AnyConnect: auto login in silent mode

This gist is for Linux. For windows is the same thing.

Connect

create a file .login_info as below:

connect your.server.url    
usernanme 
@reywood
reywood / how-to.md
Last active September 18, 2023 01:35
How to get a stack trace from a stuck/hanging python script

How to get a stack trace for each thread in a running python script

Sometimes a python script will simply hang forever with no indication of where things went wrong. Perhaps it's polling a service that will never return a value that allows the program to move forward. Here's a way to see where the program is currently stuck.

Install gdb and pyrasite

Install gdb.

# Redhat, CentOS, etc
@atotto
atotto / mqtt_test.go
Created January 25, 2017 09:02
github.com/eclipse/paho.mqtt.golang example
package mqtt_test
import (
"sync"
"testing"
mqtt "github.com/eclipse/paho.mqtt.golang"
)
func TestMqttPubSub(t *testing.T) {
@nitoyon
nitoyon / rgb.go
Created January 1, 2016 16:08
Generate Animation GIF with Golang
package main
import (
"fmt"
"image"
"image/color"
"image/gif"
"math"
"os"
)
@etoxin
etoxin / ssh.md
Last active June 10, 2020 14:20
SSH

tunnel a remote port on a server to your local machine

ssh -L 12345:localhost:5984 user@website.com

Tunnel a Website through your server to a pre defined port.

blocked websites.

@shadowbq
shadowbq / mysql-proxy.conf
Created October 1, 2014 04:00
ubuntu 14.04 upstart mysql-proxy service configuration
# mysql-proxy.conf (Ubuntu 14.04.1) Upstart proxy configuration file for AWS RDS
# mysql-proxy - mysql-proxy job file
description "mysql-proxy upstart script"
author "shadowbq <shadowbq@gmail.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn
package nettimeout
import (
"net"
"time"
)
// Listener wraps a net.Listener, and gives a place to store the timeout
// parameters. On Accept, it will wrap the net.Conn with our own Conn for us.
type Listener struct {
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@shrikeh
shrikeh / csrf-lua.conf
Created February 6, 2013 13:15
A simple nginx host file that, using the lua module, handles CSRF, rather than the backend having to (and thus generally breaking caching by having to use Set-Cookie). Here, the front end takes care of CSRF, and sends an X-CSRF-Valid header to the backend regarding the validity of the POST, so that it is advisory (the backend then choose whether…
server {
listen 80;
root /root/to/your/docroot;
proxy_redirect off;
proxy_intercept_errors on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;