Skip to content

Instantly share code, notes, and snippets.

View onlurking's full-sized avatar
:shipit:
ship it

Diogo Felix onlurking

:shipit:
ship it
View GitHub Profile
@onlurking
onlurking / arch.md
Last active March 7, 2024 16:52
Arch Linux chroot on Termux

Arch Linux

chroot on Termux

Let's download the Arch ARM image with the text-browser w3m and install proot:

apt install w3m proot
w3m http://archlinuxarm.org/os/ArchLinuxARM-utilite-latest.tar.gz
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="lambda-mod"
source $ZSH/oh-my-zsh.sh
VISUAL="nvim"
plugins=(git git-extras)
# Path Management
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"
# Aliases for utilities
export PATH="$PATH:$HOME/.npm-packages/bin"
export PATH="$PATH:$HOME/.local/bin"
export PATH="$PATH:$HOME/.gem/ruby/2.4.0/bin"
@onlurking
onlurking / veduca-dl.py
Last active March 4, 2018 04:50
Usage example: python veduca.py -u <email> -p <password> -c https://veduca.org/courses/enrolled/103099
#!/usr/bin/python
import sys
import os
import argparse
import re
import requests
from subprocess import call
async function add3(x) {
return new Promise(resolve => {
setTimeout(() => {
resolve(x + 3);
}, 2000);
});
}
async function t3() {
let x;
@onlurking
onlurking / book.py
Last active March 4, 2018 18:14
crawl elder scrolls books and save as markdown (WIP)
from splinter import Browser
from bs4 import BeautifulSoup
import tomd
from html_sanitizer import Sanitizer
# pip install tomd splinter html-sanitizer beautifulsoup4
browser = Browser(
'chrome', user_agent="Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en)")
@onlurking
onlurking / infinite.py
Last active March 6, 2018 17:44
generate all possible strings under 20 lines of Python
from itertools import count, product
from string import digits, ascii_lowercase, ascii_uppercase
from sys import stdout
import argparse
combinations = ascii_lowercase
parser = argparse.ArgumentParser()
parser.add_argument("--digits", "-d", help="include numbers", action="store_true")
parser.add_argument("--upper", "-u", help="include uppercase letters", action="store_true")
args = parser.parse_args()
@onlurking
onlurking / albums.md
Created March 30, 2018 22:20
Pitchfork's 1001 Albums You Must Hear Before You Die

Pitchfork's 1001 Albums You Must Hear Before You Die

50's

  • In The Wee Small Hours - Frank Sinatra (1955)
  • Ellington at Newport _56 - Duke Ellington (1956)
  • Elvis Presley - Elvis Presley (1956)
  • Songs For Swingin' Lovers - Frank Sinatra (1956)
  • Birth of the Cool - Miles Davis (1956)
  • Tragic Songs Of Life - The Louvin Brothers (1956)
from datetime import datetime
from collections import namedtuple
def normalize_date(ct, m = '00', s = '00'):
"""Return formated time_object with hour - 1,
and zero-filled minutes and seconds.
>>> normalize_date(datetime.strptime('Jun 1 2005 1:33PM', '%b %d %Y %I:%M%p'))
Date(year=2005, month=6, day=1, hour=12, minute='00', second='00')