Skip to content

Instantly share code, notes, and snippets.

$ rmlint  -gmk librusec_new // flibusta_new 
...
==> In total 1335219 files, whereof 371965 are duplicates in 370764 groups.
==> This equals 486.93 GB of duplicates which could be removed.
==> 22 other suspicious item(s) found, which may vary in size.
==> Scanning took in total  8h 14m 7.375s.

###
@yekm
yekm / coubackup.sh
Created March 17, 2022 08:41
backup best videos from coub
set -vx
# docker run -v /mnt/archive:/mnt --rm -it --entrypoint bash node
# apt install jq ffmpeg
# npm i -g coub-dl
# 2021 : 58
#url="https://coub.com/api/v2/best/58/coubs?type=coubs&"
# 2020 : 52
#url="https://coub.com/api/v2/best/52/coubs?type=coubs&"

Keybase proof

I hereby claim:

  • I am yekm on github.
  • I am yekm (https://keybase.io/yekm) on keybase.
  • I have a public key ASApjbVqb8ndqpXIozCQk0IeHH7q-1su8lBSrhk_dRfWdAo

To claim this, I am signing this object:

@yekm
yekm / extract_rombank.c
Created July 8, 2019 16:16
extracting rom files from rombank.bin from imbnes psx iso image
#include <sys/mman.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@yekm
yekm / sourcegrep.sh
Created September 12, 2018 10:32
dumb bash preprocessor
#!/bin/bash -evx
#replace strings like !sg{int peer_id net/receivethread.cpp} to relevant source:line string like net/receivethread.cpp:123
grep -P -o '!sg\{[^\n]+?\}' $1 | sed -e 's/}$//' -e 's/!sg{//' | while read l
do
file=$(echo "$l" | rev | cut -f 1 -d' ' | rev)
pattern=$(echo "$l" | sed -e "s; $file$;;")
pointer=$(grep -FnH "$pattern" $file | cut -f 1-2 -d: | head -n1)
echo "$file $pattern $pointer"
@yekm
yekm / test.log
Created May 14, 2018 15:08
simde tests
Running test suite with seed 0x46796a6b...
/x86/mmx/mm_set_pi8 [ OK ] [ 0.00003633 / 0.00003433 CPU ]
/x86/mmx/mm_set_pi16 [ OK ] [ 0.00003500 / 0.00003367 CPU ]
/x86/mmx/mm_set_pi32 [ OK ] [ 0.00003367 / 0.00003233 CPU ]
/x86/mmx/mm_set1_pi8 [ OK ] [ 0.00004333 / 0.00004167 CPU ]
/x86/mmx/mm_set1_pi16 [ OK ] [ 0.00003433 / 0.00003367 CPU ]
/x86/mmx/mm_set1_pi32 [ OK ] [ 0.00003233 / 0.00003167 CPU ]
/x86/mmx/mm_setr_pi8 [ OK ] [ 0.00003500 / 0.00003333 CPU ]
/x86/mmx/mm_setr_pi16 [ OK ] [ 0.00003367 / 0.00003300 CPU ]
/x86/mmx/mm_setr_pi32 [ OK ] [ 0.00003300 / 0.00003167 CPU ]
@yekm
yekm / comments
Last active February 9, 2018 08:26
various snippents
# extract lines with c-style comments
sed -ne '/\/\*/ bp; /\/\// p; b; :p; p; /\*\// b; n; bp;'
@yekm
yekm / adblock.sh
Created August 31, 2015 13:11
hostname based adblock
# add addn-hosts=/tmp/adblocker_hostlist to dnsmasq config
HOST_LISTS="
http://adaway.org/hosts.txt
http://www.malwaredomainlist.com/hostslist/hosts.txt
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&startdate%5Bday%5D=&startdate%5Bmonth%5D=&star
"
wget -O- $HOST_LISTS | sed -rn 's/^(127.0.0.1|0.0.0.0)/0.0.0.0/p' | awk '{ print $1,$2 }' | sort -uk2 | sed -r 's/([^ ]+)$/\1\n:: \1/' >/tmp/adblocker_hostlist
killall -HUP dnsmasq
@yekm
yekm / findsubimage.py
Last active August 29, 2015 14:06
pastebin
import cv2, sys
import numpy
image = cv2.imread(sys.argv[1])
image = image[318:812,468:1156,:]
template = cv2.imread(sys.argv[2])
#template = image[30:40,30:40,:]
#cv2.imshow('image', image)
@yekm
yekm / aol
Last active May 18, 2016 10:19
styles
#reader-ad-container {
display: none !important;
}
#reader-container {
margin-right: 0 !important;
// margin-top: 0 !important;
}
.article-wrap {