Skip to content

Instantly share code, notes, and snippets.

@v3l0c1r4pt0r
v3l0c1r4pt0r / fontmaker.c
Last active January 1, 2016 09:39
Bitmap creator for ST7565 based displays
//#include<windows.h>
#define GLUT_DISABLE_ATEXIT_HACK
#include <GL/glut.h>
#include <stdio.h>
#include <string.h>
#define background 1, 1, 1
#define foreground 0, 0, 0
unsigned int width = 5;
@v3l0c1r4pt0r
v3l0c1r4pt0r / xtransfer.c
Created July 6, 2014 09:01
XMODEM protocol implementation
#include <stdio.h>
#include <getopt.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <termios.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
@v3l0c1r4pt0r
v3l0c1r4pt0r / policy.h.patch
Created August 21, 2014 14:20
Patch adjusting uucp tools to work on Android without using configuration file
--- policy.h 2003-05-29 08:08:45.000000000 +0200
+++ policy.h.new 2014-08-20 12:03:45.595405893 +0200
@@ -297,7 +297,7 @@
systems the lock files are placed in /etc/locks. On some they are
placed in /usr/spool/locks. On the NeXT they are placed in
/usr/spool/uucp/LCK. */
-/* #define LOCKDIR "/usr/spool/uucp" */
+#define LOCKDIR "/data/local/etc/spool/uucp"
/* #define LOCKDIR "/etc/locks" */
/* #define LOCKDIR "/usr/spool/locks" */
@v3l0c1r4pt0r
v3l0c1r4pt0r / openswf.sh
Created January 26, 2015 19:59
Simple script to force Firefox to open SWF files
#!/bin/sh
#bash script to force firefox to open SWF files
if [ $# -lt 1 ];
then
echo "usage: $0 [filename]"
exit 1;
fi;
outfile="/tmp/swf.html"
if [[ $1 =~ /.* ]];
then
@v3l0c1r4pt0r
v3l0c1r4pt0r / rot13.c
Created February 21, 2015 13:23
ROT13 encoder/decoder
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int ch = '\0';
while((ch = fgetc(stdin)) != EOF)
{
/* for every char in stdin */
unsigned char c = (unsigned char)ch;
if(
@v3l0c1r4pt0r
v3l0c1r4pt0r / update-hekko.sh
Last active October 6, 2021 19:48
Script to regenerate Let's Encrypt certificate and update hekko.pl via DirectAdmin and certbot
#!/bin/sh
# Update hekko.pl SSL certificate page automatically with Let's Encrypt cert
# Provide $login and $pass to your environment to disable manual login page
# Outputs will be generated in CWD !
domain='example.com'
chain='chain.crt'
ca='isrgrootx1.pem'
useragent='Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0'
cookiefile='.cookies'

Keybase proof

I hereby claim:

  • I am v3l0c1r4pt0r on github.
  • I am v3l0c1r4pt0r (https://keybase.io/v3l0c1r4pt0r) on keybase.
  • I have a public key whose fingerprint is 4461 2E7B 00AB 975E 7803 B22A DCBA 7CDE 5B11 097D

To claim this, I am signing this object:

@v3l0c1r4pt0r
v3l0c1r4pt0r / vim2html.css
Created February 19, 2018 18:02
CSS stylesheet for including with :TOhtml output
/** vim2html.css
* This file consists of full CSS needed to color every default highlighting
* group of Vim syntax on :TOhtml command output
*/
.Operator { color: #ff6060; }
/*.Ignore { color: #000000; }*/
.Error { color: #ffffff; background-color: #ff6060; padding-bottom: 1px; }
.Underlined { color: #5fd7ff; text-decoration: underline; }
.Type { color: #87ffaf; }
.Todo { color: #000000; background-color: #ffff00; padding-bottom: 1px; }
@v3l0c1r4pt0r
v3l0c1r4pt0r / colorify.vim
Created February 21, 2018 17:34
Vim script to insert ANSi escape codes
function! Icolorify(color)
normal `>a
execute "normal `<i\<C-V>\<C-[>[" . a:color . "m"
endfunction
" Foreground
command! -range CBlack call Icolorify(30)
command! -range CRed call Icolorify(31)
command! -range CGreen call Icolorify(32)
command! -range CYellow call Icolorify(33)
@v3l0c1r4pt0r
v3l0c1r4pt0r / colorme.sh
Created March 15, 2018 16:01
Make your prompt colorful
#!/bin/bash
#usage: source colorme.sh [color]
color='37'
if [ $# -ge 1 ]; then
color="$1"
fi;
export PS1="\[\033[1;${color}m\][\u@\h \W]\$ \[\033[0m\]"