export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS
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
import os | |
import sys | |
SECTOR_SIZE = 512 | |
def main(): | |
try: | |
if len(sys.argv) != 4: | |
raise Exception('Not Enough Arguments') | |
else: |
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
# https://www.easeus.com/resource/fat32-disk-structure.htm | |
import struct | |
import sys | |
def getBytes(fs, pos, numBytes): | |
fs.seek(pos) | |
byte = fs.read(numBytes) | |
if (numBytes == 2): | |
formatString = "H" |
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
from random import randint | |
from time import sleep | |
flame = ' .,:;=<*i%IHM#' | |
fw = 128 # fire width | |
fh = 60 # fire height | |
fire = [] |
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
docker run -it --rm -v $(pwd):/src codacy/codacy-sqlint:latest | |
docker run -it --rm -v $(pwd):/src codacy/codacy-pylint:latest | |
docker run -it --rm -v $(pwd):/src codacy/codacy-pylint-python3:latest | |
docker run -it --rm -v $(pwd):/src codacy/codacy-remark-lint:latest | |
docker run -it --rm -v $(pwd):/src codacy/codacy-bandit:latest |
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
username=$1 | |
repos=$(curl -s https://api.github.com/users/$username/repos?per_page=1000 | jq -r '.[] | .name + "|" + .clone_url') | |
for repo in $(echo $repos | tr " " "\n") | |
do | |
name=$(echo $repo | cut -d"|" -f1) | |
clone_url=$(echo $repo | cut -d"|" -f2) | |
git clone --mirror $clone_url ./$username/$name.git && tar -czvf ./$username/$name.tgz -C ./$username/$name.git . | |
rm -rf ./$username/$name.git |
// Public repository
./gitdump.sh <repo_name>
// Your repository (public AND private)
./gitdump.sh <your_username> user
// Organization repository (public AND private)
./gitdump.sh <your_username> orgs <your_organization_name>
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
#include <LiquidCrystal.h> | |
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); | |
#define BTN_UP 1 | |
#define BTN_DOWN 2 | |
#define BTN_LEFT 3 | |
#define BTN_RIGHT 4 | |
#define BTN_SELECT 5 | |
#define BTN_NONE 10 |
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
def get_chain_length(data): | |
return max(*reduce(lambda a, i: (max(a[0], a[1]), a[1] + 1 if i > 0 else 0), data, (0, 0))) | |
data = [0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1] | |
print(get_chain_length(data)) | |
def fib(n): | |
return reduce(lambda a, i: (a[1], a[0] + a[1]), range(n), (0, 1))[0] |