Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View chrisji's full-sized avatar

Chris Inskip chrisji

View GitHub Profile
@chrisji
chrisji / send_gmail.py
Last active August 29, 2015 14:16
Send an email, using gmail.
import smtplib
message = 'message'
recipient = 'to_user@gmail.com'
sender = 'from_user@gmail.com'
password = 'password'
session = smtplib.SMTP_SSL('smtp.gmail.com:465')
session.login(sender, password)
session.sendmail(sender, recipient, message)
session.quit()
@chrisji
chrisji / decode_secret.php
Last active August 29, 2015 14:16
natas8
<?php
$encodedSecret = "3d3d516343746d4d6d6c315669563362";
function encodeSecret($secret) {
return bin2hex(strrev(base64_encode($secret)));
}
function decodeSecret($encodedSecret) {
return base64_decode(strrev(hex2bin($encodedSecret)));
}
abc dictionary.txt; cat /etc/natas_webpass/natas10 #
. /etc/natas_webpass/natas11 #
@chrisji
chrisji / concatenate.sh
Created March 13, 2015 19:40
Concatenate all m4a files in a directory. 192k bitrate. First argument is the output file name.
#!/bin/bash
for f in *.m4a; do ffmpeg -i "$f" -acodec mp3 -ac 2 -ab 192 "$f.mp3"; done
find . -name '*.mp3' -exec lame --decode '{}' - ';' | lame -b 192 - $1
@chrisji
chrisji / README.md
Last active November 20, 2018 14:02 — forked from CraigChilds94/README.md
Running Twofishes with Docker

Place the Docker Compose config file in the root of a project folder.

Ensure you've got your Docker Machine setup to use a large enough amount of memory, try 8GB.

Then run docker-compose up (or docker-compose up -d to run in detatched state)

Once you've seen the serving http/json on port 8081 message come up, run curl http://0.0.0.0:8081/\?query\=Twatt,Scotland

@chrisji
chrisji / preprocessing.py
Created June 16, 2021 10:13 — forked from m3hrdadfi/preprocessing.py
Persian Text Preprocessing
import hazm
from cleantext import clean
import emoji
import re
normalizer = hazm.Normalizer()
tagger = hazm.POSTagger(model='./resources/postagger.model')
def upper_repl(match):