Skip to content

Instantly share code, notes, and snippets.

@aniljava
aniljava / main.zig
Created October 2, 2020 17:42 — forked from desttinghim/main.zig
Zig Sqlite
const std = @import("std");
usingnamespace @cImport({
@cInclude("sqlite3.h");
});
const Error = error{
CantOpen,
Error,
Busy,
Done,
@aniljava
aniljava / ssl-renew.sh
Last active December 24, 2018 03:15
ssl-renew.sh
killall python3
wget 'https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh' -O acme.sh
chmod +x acme.sh
./acme.sh --issue -d $DOMAIN --standalone -d www.$DOMAIN --home ./
cp $DOMAIN/$DOMAIN.cer ./crt.crt
cp $DOMAIN/$DOMAIN.key ./key.key
cp $DOMAIN/fullchain.cer ./chain.crt
@aniljava
aniljava / letsencrypt
Last active September 13, 2018 15:18
letsencrypt automate script
DOMAIN=$1
wget 'https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh' -O acme.sh
chmod +x acme.sh
./acme.sh --issue -d $DOMAIN --standalone -d www.$DOMAIN --home ./
cp $DOMAIN/$DOMAIN.cer ./crt.crt
cp $DOMAIN/$DOMAIN.key ./key.key
cp $DOMAIN/fullchain.cer ./chain.crt
@aniljava
aniljava / ripgrep.-build.md
Created November 29, 2017 05:54
Could not find `avx` in `x86`
# ./compile
   ...
   Compiling bytecount v0.2.0
   Compiling ripgrep v0.7.1 (file:///xxxx/ripgrep)
error[E0432]: unresolved import `simd::x86::avx`
  --> /xxxx/.cargo/registry/src/github.com-1ecc6299db9ec823/bytecount-0.2.0/src/lib.rs:15:16
   |
15 | use simd::x86::avx::{LowHigh128, u8x32};
   |                ^^^ Could not find `avx` in `x86`
#!/usr/bin/env python2
import os
import sys
import commands
import time
import threading
origin_x = 100
origin_y = 600
@aniljava
aniljava / utils.py
Last active August 29, 2015 14:00
PYTHON MASTER LIST OF UTILS
# UUID
import uuid
get_uuid = lambda:uuid.uuid4()
# get_id, string_to_id
toid = lambda data: ''.join(['_', k.lower()][k in '0123456789-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'] for k in data)
# subfolder distribution
import os
@aniljava
aniljava / greenlet-stdout
Last active November 20, 2017 15:40
Gevent Seperate stdout per spawn
#!/usr/bin/env python2
# There should be a standard way of doing this. For now a hack.
import gevent
import inspect
def one():
print '1'
@aniljava
aniljava / gist:11029173
Last active December 16, 2019 12:58
simple-server
#!/usr/bin/env python2
import BaseHTTPServer
import SocketServer
from StringIO import StringIO
import random
import urllib2 as urllib
import shutil
class Main(BaseHTTPServer.BaseHTTPRequestHandler):
/**
* lobste.rs
* Font colors and fonts
*/
li .details .link a{
/*color:#19449c !important;*/
}
li .details .link a:visited{