Compare commits

...

2 Commits

Author SHA1 Message Date
xfnw
4603c8d047 clean up bin a bit 2021-10-16 23:18:48 -04:00
xfnw
a6bfd67e00 add mit license template to vim 2021-10-16 20:06:32 -04:00
14 changed files with 162 additions and 137 deletions

View File

@ -34,7 +34,7 @@ export LC_ALL="en_US.UTF-8"
export CDPATH=:~
export EDITOR=vim
export BROWSER=qutebrowser
export BROWSER=firefox
# start the ssh agent
[[ -z $SSH_AGENT_PID ]] && eval $(ssh-agent)

21
.vim/templates/mit Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -11,6 +11,7 @@ command Tmd :r ~/.vim/templates/md.html
command Tman :r ~/.vim/templates/man.1
command Tmh :r ~/.vim/templates/man.html
command Ttex :r ~/.vim/templates/general.tex
command Tmit :r ~/.vim/templates/mit
" run groff+refer on file
:command Groff w|!sh -c 'p="%"; refer -PS -e -p ~/Documents/bib ${p::-4}.mom | groff -mom -Tpdf > ${p::-4}.pdf'

122
bin/c Executable file
View 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"

View File

@ -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()

View File

@ -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}'

View File

@ -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

View File

@ -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
View File

@ -0,0 +1,13 @@
#!/usr/bin/env python3
import random
sortedletters = {' ': [' '], 'A': ['A', 'a', 'ᴀ', '', ''], 'B': ['B', 'b', 'ß', 'ʙ', 'ẞ', '', ''], 'C': ['C', 'c', 'ʗ', '', '', ''], 'D': ['D', 'd', 'Ɖ', 'ᴅ', '', ''], 'E': ['⊘', 'E', 'e', 'ᴇ', '', 'ꭡ', '', ''], 'F': ['F', 'f', '', '', ''], 'G': ['G', 'g', 'ɡ', 'ɢ', '', ''], 'H': ['H', 'h', 'ʜ', '', ''], 'I': ['⫮', 'I', 'i', 'ı', 'ɪ', '', ''], 'J': ['J', 'j', 'ȷ', 'ᴊ', '', ''], 'K': ['K', 'k', 'ᴋ', '', ''], 'L': ['L', 'l', 'ʟ', '', ''], 'M': ['M', 'm', 'ᴍ', '', ''], 'N': ['Nj', 'N', 'n', 'ɴ', '', ''], 'O': ['O', 'o', '', '', ''], 'P': ['P', 'p', 'ᴘ', '', ''], 'Q': ['Q', 'q', '', ''], 'R': ['R', 'r', 'ʀ', '', '', '', 'ſ'], 'S': ['S', 's', '', ''], 'T': ['T', 't', 'ᴛ', '', ''], 'U': ['U', 'u', '', '', ''], 'V': ['V', 'v', '', '', ''], 'W': ['W', 'w', '', '', ''], 'X': ['X', 'x', '', ''], 'Y': ['Y', 'y', 'ʏ', '', ''], 'Z': ['Z', 'z', 'Dz', '', '', ''], '/': ['', '', '/', '', '⹊', '', '🙼'], '\\': ['\\', '', '', '', '🙽'], '!': ['', '!'], '~': ['','~'], '#':['','#'], '.':['.'], ',':[',']}
while True:
inp = input().upper()
for l in inp:
print(random.choice(sortedletters[l] if l in sortedletters else l),end='',flush=True)
print()

View File

@ -1,3 +0,0 @@
#!/bin/bash
zbarcam --raw -Sdisable -Scode128.enable

View File

@ -1,3 +0,0 @@
#!/bin/bash
zbarcam --raw --nodisplay -Sdisable -Scode128.enable

4
bin/rusb Executable file
View 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
View File

@ -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

View File

@ -1,3 +0,0 @@
#!/bin/bash
zbarcam --raw -Sdisable -Scode128.enable | crikey -i