This file contains hidden or 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 | |
| cachedir="${XDG_CACHE_HOME:-$HOME/.cache}" | |
| synclient ClickFinger3=2 | |
| synclient TapButton3=2 | |
| synclient EmulateMidButtonTime=50 | |
| pkill syndaemon | |
| syndaemon -d -t -K -i 1.0 |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| worklog_dir="worklog" | |
| editor="subl" | |
| show_usage () { | |
| cat <<-EOF | |
| Create a diary text file by week in the $worklog_dir subdirectory | |
| by the year and month. Automagically adds a heading to the file | |
| and opens the file with $editor to the current* date. |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import math | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| # def string_shannon(data): | |
| # '''Performs a Shannon entropy analysis on a given block of data. |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| # Or python2 | |
| import itertools | |
| import collections | |
| # @profile | |
| def get_primes(nMax): | |
| """Return a set of prime numbers under nMax |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| from heapq import heappush, heappop | |
| median = None | |
| heap_lower = [] | |
| heap_upper = [] | |
| len_lower = 0 |
This file contains hidden or 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
| # https://stackoverflow.com/a/52465819 | |
| function readline_ANSI_escape() { | |
| if [[ $# -ge 1 ]]; then | |
| echo "$*" | |
| else | |
| cat # Read string from STDIN | |
| fi | \ | |
| perl -pe 's/(?:(?<!\x1)|(?<!\\\[))(\x1b\[[0-9;]*[mG])(?!\x2|\\\])/\x1\1\x2/g' | |
| } |
This file contains hidden or 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
| #/usr/bin/env python3 | |
| import time | |
| import threading | |
| import functools | |
| import tqdm | |
| def long_running_function(*args, **kwargs): |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <limits.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <fcntl.h> | |
| #include <sys/mman.h> |
This file contains hidden or 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
| #!/usr/bin/env python2 | |
| import math | |
| from pwn import * | |
| """ | |
| Read this: https://inst.eecs.berkeley.edu/~cs191/fa07/lectures/lecture22_fa07.pdf | |
| I don't really know much about quantum computers. | |
| Credit goes to [bobert](https://github.com/rstrand2357) for figuring out how to solve this. |
This file contains hidden or 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
| #!/usr/bin/env python2 | |
| """ | |
| Angr would probably be the nice way to solve this. Oh well. | |
| Brute force worked for me. | |
| Trying different inputs, it seems the length doesn't matter. | |
| The output changes depending on how many characters at the beginning match the key. | |
| Brute force possible keys watching for output changes (to know when we got the right letter) |