Skip to content

Instantly share code, notes, and snippets.

View weskerfoot's full-sized avatar

Wesley Kerfoot weskerfoot

View GitHub Profile
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --generate-hashes requirements.txt
#
--index-url http://devpi.internal.kn0x.io/ci/archlinux/+simple/
--trusted-host devpi.internal.kn0x.io
certifi==2020.12.5 \
#include <stdio.h>
#include <stdlib.h>
struct Foo {
int a;
int arr[];
};
struct Foo*
f(int n) {
@weskerfoot
weskerfoot / continue_ftp.sh
Created December 23, 2020 17:00
Resume upload of a folder to a remote server using LFTP #lftp
lftp -e 'mirror -c -R /path/to/local/folder /path/to/remote/folder' -u 'your_username,your_password' the-remote-ftp-server.com
# -c means resume the upload where you left off the last time you ran lftp before it got terminated.
# -R means reverse mirror. This will tell lftp to upload from local to remote, instead of download from remote to local.
def f(): yield f()
def evaluate(g):
g = g()
while g:
g = next(g)
print(g)
evaluate(f)
<?xml version="1.0" encoding="UTF-8"?>
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>label</key>
<string>com.startup.sshd</string>
<key>ProgramArguments</key>
<array>
<string>/Users/dev/start_ssh</string>
import praw
import yfinance as yf
from os import environ
from collections import defaultdict
from queue import Queue as queue
from re import search
reddit = praw.Reddit(client_id=environ.get("CLIENT_ID"),
client_secret=environ.get("SECRET"),
password=environ.get("PASSWORD"),
import posix, system, os, memfiles
var program: array[0..4, uint8] = [
# mov eax, 42 (0x2a)
0xb8.uint8, 0x2a.uint8, 0x00.uint8, 0x00.uint8,
# ret
0xc3.uint8
]
const kProgramSize: int = program.sizeof
import typeinfo, tables, typetraits
type Function = tuple[name: string, p : pointer]
var funcs : Table[string, Function]
proc foo(x : int) : int =
x * x
proc bar(x : float) : float =
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>
typedef void* (*real_dlopen_t)(const char*, int);
void*
real_dlopen(const char *filename, int flags) {
return ((real_dlopen_t)dlsym(RTLD_NEXT, "dlopen"))(filename, flags);
}
import os, httpclient, json, strformat, tables, strutils
proc cloneAdmin() =
return
proc addRepo() =
return
proc rmRepo() =
return