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 <unistd.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <termios.h> | |
#include <signal.h> | |
struct termios orig; | |
void term_cursor_setpos(int row, int col) { |
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/sh | |
awk -i inplace -f - "$1" << 'AWK' | |
BEGIN { | |
skip = 0 | |
IGNORECASE=1 | |
} | |
/\\begin{(minted|lstlisting|tikzpicture)}/ { | |
skip = 1 | |
} |
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/sh | |
history_dir=~/.cloudflare/dns_history | |
auth_email=$(awk -F = '/email/ {print $2}' ~/.cloudflare/cloudflare.cfg) | |
auth_key=$(awk -F = '/token/ {print $2}' ~/.cloudflare/cloudflare.cfg ) | |
zone_name=$1 | |
zone_file="$history_dir/$zone_name" | |
if [ -z "$zone_name" ]; then | |
echo "Usage: $0 zone.tld" |
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 <vector> | |
#include <functional> | |
void test(int a, int b) { | |
printf("%d %d\n", a, b); | |
} | |
void testStr(const char* a) { | |
printf("%s\n", a); |
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
void test() { | |
int tests = 1000; | |
Timer timer; | |
timer.reset(); | |
timer.start(); | |
int begin = timer.read_us(); | |
wait(1); | |
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/sh | |
container=$1 | |
pass=$2 | |
if [ -z "$container" ] || [ -z "$pass" ]; then | |
echo "usage: $0 container newRootPassword" | |
exit | |
fi | |
mysql_image=$(docker inspect $container --format "{{ .Config.Image }}") |
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 sqlite3 | |
import string | |
import passwordmeter | |
from termcolor import colored | |
import secrets | |
import pyperclip | |
import os | |
import tempfile | |
import shutil |
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 pyparsing import * | |
class Function: | |
def __init__(self, tokens): | |
self.type = tokens[0] | |
self.name = tokens[1] | |
self.args = tokens[2] if len(tokens) > 2 else "" | |
def __repr__(self): |
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 enum import Enum | |
import logging | |
class ParseException(Exception): | |
pass | |
class Tokens(Enum): | |
START_PROPS = 1 |
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 | |
[email protected] | |
pass=insert_apikey | |
zone_id=insert_zone_id | |
domain=$(hostname --fqdn) | |
addr=$(ip a | grep 'inet6 2001' | awk '{print $2}' | cut -d '/' -f 1) | |
if [ "$domain" == "arch" ]; then | |
echo "not updating" |
NewerOlder