Skip to content

Instantly share code, notes, and snippets.

@shyd
shyd / Dockerfile
Last active Apr 26, 2022
install php imap in dockerfile
View Dockerfile
FROM php:5-apache
RUN apt-get update && \
apt-get install -y \
libc-client-dev libkrb5-dev && \
rm -r /var/lib/apt/lists/*
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ext-install -j$(nproc) imap
@shyd
shyd / Dockerfile
Last active Apr 1, 2022
install locales inside a docker image
View Dockerfile
FROM debian
RUN apt-get update && \
apt-get install -y \
locales && \
rm -r /var/lib/apt/lists/*
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales
@shyd
shyd / remove_diacritics.js
Last active May 6, 2021 — forked from yeah/remove_diacritics.js
Remove diacritics (Umlauts, Accents, Special characters) in JavaScript
View remove_diacritics.js
const diacriticsMap = [
{'base':'A', 'letters':/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},
{'base':'AA','letters':/[\uA732]/g},
{'base':'AE','letters':/[\u00C4\u00C6\u01FC\u01E2]/g},
{'base':'AO','letters':/[\uA734]/g},
{'base':'AU','letters':/[\uA736]/g},
{'base':'AV','letters':/[\uA738\uA73A]/g},
{'base':'AY','letters':/[\uA73C]/g},
{'base':'B', 'letters':/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},
{'base':'C', 'letters':/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},
@shyd
shyd / avd-root-whatsapp.md
Last active Nov 3, 2020
Get root access and gapps in AVD emulator to extract WhatsApp Messages
View avd-root-whatsapp.md
@shyd
shyd / chrome-flags.md
Last active Sep 23, 2019
Chrome flags omnibar showprotocol
View chrome-flags.md

set both to disabled

chrome://flags/#omnibox-ui-hide-steady-state-url-scheme
chrome://flags/#omnibox-ui-hide-steady-state-url-trivial-subdomains
@shyd
shyd / InstagramScraper.md
Created Jan 15, 2018
How to get Instagram media and info
View InstagramScraper.md

Instagram Scraper

Get users media

https://www.instagram.com/username/?__a=1

if user.media.page_info.has_next_page is true, continue with

https://www.instagram.com/username/?__a=1&max_id=<user.media.page_info.end_cursor>

View vag_cdc.py
# replace function `play_cd` with this one to play a playlist instead of folder `cd6`
# This assumes you have a playlist ready in `/var/lib/mpd/playlists/myAwesomePlaylist.m3u`
# load new cd-dir
def play_cd(cd_no):
if ser.read() == CDC_END_CMD and ser.read() == CDC_CDSET:
if str(cd_no) == "6":
os.popen("mpc clear")
os.popen("mpc load myAwesomePlaylist")
os.popen("mpc play")
@shyd
shyd / PRECALCULATE_WAVEFORMS.md
Last active Sep 22, 2017
How to precalculate sine with js.
View PRECALCULATE_WAVEFORMS.md

Waveforms

precalculated sine with js

Run the following code on JSFiddle with the proper amplitude set:

var count = 0;
var max_amplitude=4095;
var amplitude=3800;