Skip to content

Instantly share code, notes, and snippets.

View ttimasdf's full-sized avatar

Known Rabbit ttimasdf

View GitHub Profile
@ttimasdf
ttimasdf / cve.patch
Last active December 18, 2017 02:04
My cve-search patch
diff --git a/sbin/db_mgmt_cpe_dictionary.py b/sbin/db_mgmt_cpe_dictionary.py
index 4c904cf..37cd9c8 100755
--- a/sbin/db_mgmt_cpe_dictionary.py
+++ b/sbin/db_mgmt_cpe_dictionary.py
@@ -31,6 +31,7 @@ from lib.ProgressBar import progressbar
from lib.Toolkit import toStringFormattedCPE
from lib.Config import Configuration
import lib.DatabaseLayer as db
+from time import time
@ttimasdf
ttimasdf / fix_virtualenv
Last active September 4, 2019 15:18 — forked from tevino/fix_virtualenv
Fix python virtualenv after python update, forked version for choice of python executable
#!/usr/bin/env bash
ENV_PATH="$(dirname "$(dirname "$(which pip)")")"
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)"
echo "Ensure the root of current virtualenv:"
echo " $ENV_PATH"
read -p "‼️ Say no if you are not sure (y/N) " -n 1 -r
echo
PYEXC_DEF="$(sed -n '1s/^#!//p' $SYSTEM_VIRTUALENV)"
read -p "🐍 Choose which python to use? [$PYEXC_DEF] " PYEXC
@ttimasdf
ttimasdf / zshrc.sh
Last active August 10, 2017 02:47
My .zshrc with ohmyzsh and bullet train theme, includes various utilities for easy life
export ZSH=/Users/u/.oh-my-zsh
# Bullet train needs powerline fonts unavailable in VSCode
# ps -p `ps -o pid,ppid | awk "/^ *$$/ {print \$2}"` | grep -q "Visual Studio Code" && ZSH_THEME="random"
[[ -n "$VSCODE_PID" ]] && ZSH_THEME="random" || ZSH_THEME="bullet-train"
plugins=(git brew virtualenv osx zsh-completions)
# DISABLE_AUTO_UPDATE="true"
# export UPDATE_ZSH_DAYS=13
BULLETTRAIN_CUSTOM_MSG="Rabbit!"
@ttimasdf
ttimasdf / 00_MIGRATE_KEY.md
Last active August 22, 2023 15:30
Migrate your OTA key, step by step guide

Goal

Migrate from self-built (test-key or dev-key) or Official Release from https://download.lineageos.org/, to our self-signed builds, RETAINING DATA!!! and avoid the annoying error:

Can't install this package on top of incompatible data. Please try another package or run a factory reset

Usage

Apply the two patch accordingly, with command below. (Changed a little bit from 156047 and 162144

@ttimasdf
ttimasdf / awstats-nginx.conf
Last active August 31, 2021 22:44
Fancy&customized URL support for awstats with Nginx. Access through http://example.com/awstats/
server {
listen 127.0.0.1:81;
server_name _;
access_log /var/log/nginx/awstats.access_log combined;
error_log /var/log/nginx/awstats.error_log;
root /usr/share/awstats/wwwroot;
index /awstats.pl;
location ~ \.pl$ {
@ttimasdf
ttimasdf / Open iterm tab here
Last active March 1, 2020 17:49 — forked from eric-hu/Open iterm tab here
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder.To use:(1) Open Automator(2) Create a new service(3) Change "Service receives selected" drop downs to "Files or folders" in "Finder"(4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set is_folder to (do shell script "file -b " & quoted form of (POSIX path of my_file))
if is_folder ends with "directory" then