Skip to content

Instantly share code, notes, and snippets.

View elmoallistair's full-sized avatar
🛌
Working from bedroom

Elmo elmoallistair

🛌
Working from bedroom
View GitHub Profile
@elmoallistair
elmoallistair / decrypt.py
Created October 12, 2021 12:14
advanced-encryption-standard
from Cryptodome.Cipher import AES
import argparse
import traceback
parser = argparse.ArgumentParser()
parser.add_argument("-f", dest="FILE_PATH", required=True, help="Encrypted file path")
parser.add_argument("-k", dest="KEY_PATH", required=True, help="Key file path")
parser.parse_args()
args = parser.parse_args()
@elmoallistair
elmoallistair / keychron_linux.md
Created March 3, 2021 03:01 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux (+ bluetooth fixes)

Here the best setup (I think so :D) for Keychron + Linux

Make Fn + F-keys work

  • Step 1: Set fkeyfirst by:
    • Create the file /etc/modprobe.d/hid_apple.conf. Add this line to the file: options hid_apple fnmode=2
    • Save the file and execute the following command: sudo update-initramfs -u
    • Reboot
  • Step 2: Use the keyboard in Windows/Android mode
  • Step 3: If get stuck with numpad mode: Double hit F6 or fn + F6. I've been using this config since the very first day, both bluetooth and cable with no problem.
@elmoallistair
elmoallistair / coursera-dl.sh
Created February 23, 2021 03:04
personal coursera-dl template
coursera-dl \
-ca <CAUTH> \
<COURSE> \
-sl en \
--ignore-formats txt,html \
--specialization \
--video-resolution 720p \
--download-delay 0 \
--download-notebooks
@elmoallistair
elmoallistair / gcp-ocr.sh
Created November 5, 2020 04:52
perform simple ocr that automatically extract text from images in bucket and translate it in google cloud using cloud function, pubsub, vision and translation api
# Create virtualenv
virtualenv venv
source venv/bin/activate
# Installing packages
pip install -r requirements.txt
# Enable APIs
gcloud services enable cloudbuild.googleapis.com
gcloud services enable cloudfunctions.googleapis.com
@elmoallistair
elmoallistair / .bashrc
Created October 18, 2020 13:07
default .bashrc configuration (Ubuntu /etc/skel/.bashrc)
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@elmoallistair
elmoallistair / terminal-col
Created October 16, 2020 04:51
terminal color | Personal configuration
# General
#F3F3F3 #272A34 #AA0000
# Pallete
#272A34 #DE1616 #28C436 #C4A000 #23518D #75507B #06989A #DDEBCE
#555753 #EF2929 #3C7116 #FCE94F #739FCF #AD7FA8 #34E2E2 #EEEEEC
@elmoallistair
elmoallistair / gtk.css
Last active October 16, 2020 04:31
~/.config/gtk-3.0/gtk.css | Personal configuration
/* Terminal Padding */
VteTerminal,
TerminalScreen,
vte-terminal {
padding: 10px 10px 10px 10px;
-VteTerminal-inner-border: 10px 10px 10px 10px;
}
/* Headerbar padding */
window.ssd headerbar.titlebar {
@elmoallistair
elmoallistair / .p10k.zsh
Last active October 12, 2023 18:37
powerlevel10k | Personal configuration
# Generated by Powerlevel10k configuration wizard on 2020-10-15 at 21:56 WIB.
# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 00302.
# Wizard options: nerdfont-complete + powerline, large icons, rainbow, unicode,
# 24h time, slanted separators, sharp heads, sharp tails, 2 lines, solid, right frame,
# lightest-ornaments, sparse, many icons, concise, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with powerline prompt style with colorful background.
# Type `p10k configure` to generate your own config based on it.
#
@elmoallistair
elmoallistair / .zshrc
Last active October 16, 2020 04:34
.zshrc file | Personal configuration
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export ZSH="/home/elmoallistair/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
@elmoallistair
elmoallistair / s2t-translator
Last active July 12, 2021 15:05
Speech to Text and Language Translator using IBM Cloud and Python
# See the project: https://github.com/elmoallistair/watson-s2t-language-translator
# Importing required modules
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_watson import SpeechToTextV1
from ibm_watson import LanguageTranslatorV3
from pandas import json_normalize
# Specifies the sample audio
filename = '<AUDIO_FILE>.mp3'