This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ] | |
then | |
echo "usage: sudo ./$0 TARGET_IP" | |
exit 1 | |
fi | |
mkdir nmap | |
nmap -p- -sU -n --max-retries 3 --max-scan-delay 1 $1 -oN nmap/all-udp.txt & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"github.com/filecoin-project/index-provider/engine" | |
"github.com/filecoin-project/index-provider/metadata" | |
"github.com/filecoin-project/storetheindex/api/v0/ingest/schema" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testdir="/tmp/testfs" | |
esturl="http://localhost:3004" | |
# create a collection on estuary first with: curl -X POST http://localhost:3004/collections/create -d '{ "name": "A new collection", "description": "A new collection test" }' -H "Content-Type: application/json" -H "Authorization: Bearer $APIKEY" | |
# then paste the collection's UUID below | |
coluuid="YOUR-COLLECTION-UUID" | |
# make sure it's empty | |
rm -rf $testdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message=$(curl http://whatthecommit.com | grep \<p\> | cut -d ">" -f 2) | |
git add . | |
git commit -m "$message" | |
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: clean stack1 bof1 | |
stack1: clean | |
gcc stack1.c -o stack1 | |
bof1: clean | |
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space | |
gcc bof1.c -fno-stack-protector -o bof1 | |
bof2: clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/ddclient.conf | |
cache=/var/cache/ddclient/ddclient.cache | |
pid=/var/run/ddclient.pid | |
daemon=300 | |
syslog=yes | |
ssl=yes | |
protocol=cloudflare | |
ttl=1 | |
use=web | |
web=bot.whatismyipaddress.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nmcli dev status # show devices connected and not connected | |
nmcli con show # show active and old connections | |
nmcli con mod CONNECTION_NAME ipv4.method manual # modify a connection from DHCP to static IP connect | |
nmcli con mod CONNECTION_NAME ipv4.addresses 192.168.0.X/24 # set the static IP to use in a connection | |
nmcli con mod CONNECTION_NAME ipv4.gateway 192.168.0.Y # set the default gateway of a connection | |
# Finally, revert changes after DHCP is setup | |
nmcli con mod CONNECTION_NAME ipv4.method auto ipv4.addresses "" ipv4.gateway "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tests whether python optimizes file reads or not | |
# Spoiler: apparently it does but it doesn't make much of a difference for this experiment | |
import time | |
def count_time(func): | |
def wrapper(*args, **kwargs): | |
start = time.time() | |
func(*args, **kwargs) | |
end = time.time() | |
print(f"Time: \t{format(end - start, '.9f')}s") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I use French as the default system language but wanted my terminal to use en_US | |
# Change 'en_US' to the language you want your terminal to be | |
# Change 'gnome-terminal' to the command that calls your terminal emulator (e.g. konsole, xterm,...) | |
LANG=en_US gnome-terminal | |
# After that, create the shortcut (e.g. Ctrl+Alt+T) and name the action: | |
# /bin/bash /path/to/term-dif-lang.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example: ./xcreep.sh somefile.txt | |
if [ $# -ne 1 ] | |
then | |
echo "usage: $0 <INPUTFILE>" | |
exit 1 | |
fi | |
INPUTFILE=$1 | |
cat $INPUTFILE | xclip -selection c |