Skip to content

Instantly share code, notes, and snippets.

@lxndrv
lxndrv / ubuntu-setup.sh
Created April 7, 2022 21:29
Setup Ubuntu development tools
sudo apt update && sudo apt upgrade -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release \
software-properties-common apt-transport-https \
wget git chromium-browser python3.8 python3-pip
@lxndrv
lxndrv / ngram.sh
Last active March 19, 2022 03:05
Ngram in bash with awk
cat << 'EOF' > ngram.sh
#Helper function to count ngrams
function soniq(){
sort | uniq -c | sort -nr
}
#Usage: cat file.txt | ngram 3 | soniq | head -20
function ngram(){
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
cd /usr/src
sudo wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
sudo tar xzf Python-2.7.12.tgz
cd Python-2.7.12
sudo ./configure