clean up bin a bit
This commit is contained in:
parent
a6bfd67e00
commit
4603c8d047
11 changed files with 139 additions and 136 deletions
122
bin/c
Executable file
122
bin/c
Executable file
|
@ -0,0 +1,122 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# https://causal.agency/bin/c.html
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
temp=$(mktemp -d)
|
||||||
|
trap 'rm -r "${temp}"' EXIT
|
||||||
|
|
||||||
|
exec 3>>"${temp}/run.c"
|
||||||
|
|
||||||
|
cat >&3 <<EOF
|
||||||
|
#include <assert.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
#include <wctype.h>
|
||||||
|
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <strings.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
EOF
|
||||||
|
|
||||||
|
expr=
|
||||||
|
type=
|
||||||
|
while getopts 'e:i:t' opt; do
|
||||||
|
case "${opt}" in
|
||||||
|
(e) expr=$OPTARG;;
|
||||||
|
(i) echo "#include <${OPTARG}>" >&3;;
|
||||||
|
(t) type=1;;
|
||||||
|
(?) exit 1;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
|
cat >&3 <<EOF
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
$*;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ -n "${type}" ]; then
|
||||||
|
cat >&3 <<EOF
|
||||||
|
printf(
|
||||||
|
_Generic(
|
||||||
|
${expr},
|
||||||
|
char: "(char) ",
|
||||||
|
char *: "(char *) ",
|
||||||
|
const char *: "(const char *) ",
|
||||||
|
wchar_t *: "(wchar_t *) ",
|
||||||
|
const wchar_t *: "(const wchar_t *) ",
|
||||||
|
signed char: "(signed char) ",
|
||||||
|
short: "(short) ",
|
||||||
|
int: "(int) ",
|
||||||
|
long: "(long) ",
|
||||||
|
long long: "(long long) ",
|
||||||
|
unsigned char: "(unsigned char) ",
|
||||||
|
unsigned short: "(unsigned short) ",
|
||||||
|
unsigned int: "(unsigned int) ",
|
||||||
|
unsigned long: "(unsigned long) ",
|
||||||
|
unsigned long long: "(unsigned long long) ",
|
||||||
|
float: "(float) ",
|
||||||
|
double: "(double) ",
|
||||||
|
long double: "(long double) ",
|
||||||
|
default: "(void *) "
|
||||||
|
)
|
||||||
|
);
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${expr}" ]; then
|
||||||
|
cat >&3 <<EOF
|
||||||
|
printf(
|
||||||
|
_Generic(
|
||||||
|
${expr},
|
||||||
|
char: "%c\n",
|
||||||
|
char *: "%s\n",
|
||||||
|
const char *: "%s\n",
|
||||||
|
wchar_t *: "%ls\n",
|
||||||
|
const wchar_t *: "%ls\n",
|
||||||
|
signed char: "%hhd\n",
|
||||||
|
short: "%hd\n",
|
||||||
|
int: "%d\n",
|
||||||
|
long: "%ld\n",
|
||||||
|
long long: "%lld\n",
|
||||||
|
unsigned char: "%hhu\n",
|
||||||
|
unsigned short: "%hu\n",
|
||||||
|
unsigned int: "%u\n",
|
||||||
|
unsigned long: "%lu\n",
|
||||||
|
unsigned long long: "%llu\n",
|
||||||
|
float: "%g\n",
|
||||||
|
double: "%g\n",
|
||||||
|
long double: "%Lg\n",
|
||||||
|
default: "%p\n"
|
||||||
|
),
|
||||||
|
${expr}
|
||||||
|
);
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $# -eq 0 -a -z "${expr}" ]; then
|
||||||
|
cat >&3
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo '}' >&3
|
||||||
|
|
||||||
|
cat >"${temp}/Makefile" <<EOF
|
||||||
|
CFLAGS += -Wall -Wextra -Wpedantic
|
||||||
|
EOF
|
||||||
|
|
||||||
|
make -s -C "${temp}" run
|
||||||
|
"${temp}/run"
|
|
@ -1,36 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
print('lickthecheese\'s assorted code.org modulus cracking tools')
|
|
||||||
|
|
||||||
def crack():
|
|
||||||
print('note: if no valid keypair exists, it will continue searching forever.')
|
|
||||||
print('press CTRL+c to cancel')
|
|
||||||
m = int(input('pub modulus> '))
|
|
||||||
p = int(input('pub key> '))
|
|
||||||
n = int(input('pub number> '))
|
|
||||||
|
|
||||||
i = 1
|
|
||||||
|
|
||||||
while p*i % m != 1:
|
|
||||||
i=i+1
|
|
||||||
|
|
||||||
print('done!')
|
|
||||||
print('alice\'s secret key is ', i)
|
|
||||||
print('bob\'s secret number is', ((i*n)%m))
|
|
||||||
|
|
||||||
def genbob():
|
|
||||||
m = int(input('pub modulus> '))
|
|
||||||
p = int(input('pub key> '))
|
|
||||||
n = int(input('secret number> '))
|
|
||||||
|
|
||||||
print('bob\'s public number is', ((p*n)%n))
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
print('0 crack secret key and number')
|
|
||||||
print('1 generate public number')
|
|
||||||
|
|
||||||
choice = int(input('choose tool> '))
|
|
||||||
func = [crack, genbob][choice]
|
|
||||||
|
|
||||||
func()
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
awk '{print $2}' $1 |
|
|
||||||
awk -F ":" '{print $1}' |
|
|
||||||
cat - ~/Documents/nums |
|
|
||||||
sort | uniq -c | sort -k2 |
|
|
||||||
awk '{print $1-1}'
|
|
||||||
|
|
8
bin/chfo
8
bin/chfo
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
chainfo $1 > /tmp/chacha
|
|
||||||
|
|
||||||
MACS=$(sort -h /tmp/chacha | tail -n 1)
|
|
||||||
|
|
||||||
awk '{print $1/'$MACS'*100}' /tmp/chacha
|
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import math, sys
|
|
||||||
|
|
||||||
si = input('size append d r c a> ')
|
|
||||||
print()
|
|
||||||
st = si[-1:]
|
|
||||||
|
|
||||||
try:
|
|
||||||
si = float(si[:-1])
|
|
||||||
except:
|
|
||||||
print('invalid input, please use the format <value><type letter>')
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
def fromD(di):
|
|
||||||
r = di/2
|
|
||||||
fromR(r)
|
|
||||||
|
|
||||||
def fromC(ce):
|
|
||||||
r = ce / 6.28
|
|
||||||
fromR(r)
|
|
||||||
|
|
||||||
def fromA(ar):
|
|
||||||
r = math.sqrt(ar/3.14)
|
|
||||||
fromR(r)
|
|
||||||
|
|
||||||
def fromR(ra):
|
|
||||||
print("radius",ra)
|
|
||||||
print("diam", ra*2)
|
|
||||||
print("cerc", 3.14 * (ra*2))
|
|
||||||
print("area", 3.14*(ra*ra))
|
|
||||||
|
|
||||||
funcs = {
|
|
||||||
'd':fromD,
|
|
||||||
'r':fromR,
|
|
||||||
'c':fromC,
|
|
||||||
'a':fromA
|
|
||||||
}
|
|
||||||
|
|
||||||
if st in funcs:
|
|
||||||
funcs[st](si)
|
|
||||||
else:
|
|
||||||
print("invalid value type, the options are:")
|
|
||||||
for i in funcs:
|
|
||||||
print(i)
|
|
||||||
|
|
||||||
|
|
13
bin/ranal
Executable file
13
bin/ranal
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import random
|
||||||
|
|
||||||
|
sortedletters = {' ': [' '], 'A': ['A', 'a', 'ᴀ', 'A', 'a'], 'B': ['B', 'b', 'ß', 'ʙ', 'ẞ', 'B', 'b'], 'C': ['C', 'c', 'ʗ', 'ᴄ', 'C', 'c'], 'D': ['D', 'd', 'Ɖ', 'ᴅ', 'D', 'd'], 'E': ['⊘', 'E', 'e', 'ᴇ', 'ꬲ', 'ꭡ', 'E', 'e'], 'F': ['F', 'f', 'ꬵ', 'F', 'f'], 'G': ['G', 'g', 'ɡ', 'ɢ', 'G', 'g'], 'H': ['H', 'h', 'ʜ', 'H', 'h'], 'I': ['⫮', 'I', 'i', 'ı', 'ɪ', 'I', 'i'], 'J': ['J', 'j', 'ȷ', 'ᴊ', 'J', 'j'], 'K': ['K', 'k', 'ᴋ', 'K', 'k'], 'L': ['L', 'l', 'ʟ', 'L', 'l'], 'M': ['M', 'm', 'ᴍ', 'M', 'm'], 'N': ['Nj', 'N', 'n', 'ɴ', 'N', 'n'], 'O': ['O', 'o', 'ᴏ', 'O', 'o'], 'P': ['P', 'p', 'ᴘ', 'P', 'p'], 'Q': ['Q', 'q', 'Q', 'q'], 'R': ['R', 'r', 'ʀ', 'ꭈ', 'R', 'r', 'ſ'], 'S': ['S', 's', 'S', 's'], 'T': ['T', 't', 'ᴛ', 'T', 't'], 'U': ['U', 'u', 'ᴜ', 'U', 'u'], 'V': ['V', 'v', 'ᴠ', 'V', 'v'], 'W': ['W', 'w', 'ᴡ', 'W', 'w'], 'X': ['X', 'x', 'X', 'x'], 'Y': ['Y', 'y', 'ʏ', 'Y', 'y'], 'Z': ['Z', 'z', 'Dz', 'ᴢ', 'Z', 'z'], '/': ['⁄', '∕', '/', '⧸', '⹊', '/', '🙼'], '\\': ['\\', '⧹', '﹨', '\', '🙽'], '!': ['!', '!'], '~': ['~','~'], '#':['#','#'], '.':['.'], ',':[',']}
|
||||||
|
|
||||||
|
while True:
|
||||||
|
|
||||||
|
inp = input().upper()
|
||||||
|
|
||||||
|
for l in inp:
|
||||||
|
print(random.choice(sortedletters[l] if l in sortedletters else l),end='',flush=True)
|
||||||
|
print()
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
zbarcam --raw -Sdisable -Scode128.enable
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
zbarcam --raw --nodisplay -Sdisable -Scode128.enable
|
|
||||||
|
|
4
bin/rusb
Executable file
4
bin/rusb
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
echo -n "0000:00:1a.0" | tee /sys/bus/pci/drivers/ehci-pci/unbind
|
||||||
|
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/unbind
|
||||||
|
echo -n "0000:00:1a.0" | tee /sys/bus/pci/drivers/ehci-pci/bind
|
||||||
|
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/bind
|
28
bin/smb
28
bin/smb
|
@ -1,28 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
export SMBPATH="smb.txt"
|
|
||||||
|
|
||||||
export SMBID=$RANDOM
|
|
||||||
|
|
||||||
echo "welcome to smb"
|
|
||||||
|
|
||||||
if [[ ! -f $SMBPATH ]];then
|
|
||||||
read -p "Initilize smb in $SMBPATH ? "
|
|
||||||
echo "--top--" >> $SMBPATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
read -p "title your post: " TITLE
|
|
||||||
|
|
||||||
mkdir /tmp/smb/$USER/ -p
|
|
||||||
vim /tmp/smb/$USER/$SMBID
|
|
||||||
if [[ -f "/tmp/smb/$USER/$SMBID" ]];then
|
|
||||||
echo "================================================================================">> /tmp/smb/$USER/$SMBID.t
|
|
||||||
echo "Title: $TITLE" >> /tmp/smb/$USER/$SMBID.t
|
|
||||||
date "+Posted on: %Y-%m-%d\\" | tr '\\\\' "\n" >> /tmp/smb/$USER/$SMBID.t
|
|
||||||
cat /tmp/smb/$USER/$SMBID >> /tmp/smb/$USER/$SMBID.t
|
|
||||||
echo -e "================================================================================\n\n" >> /tmp/smb/$USER/$SMBID.t
|
|
||||||
sed -i "/--top--/r /tmp/smb/$USER/$SMBID.t" $SMBPATH
|
|
||||||
else
|
|
||||||
echo "aborting..."
|
|
||||||
fi
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
zbarcam --raw -Sdisable -Scode128.enable | crikey -i
|
|
||||||
|
|
Loading…
Reference in a new issue