Skip to content

Instantly share code, notes, and snippets.

@gdiaz384
gdiaz384 / compilefairseq.bat
Last active February 8, 2024 07:58
This script attempts to compile fairseq from source on Windows. See full writeup for details and Linux.
:: This script attempts to compile fairseq from source on Windows, however it makes a lot of assumptions.
:: For a full writeup, see: https://github.com/gdiaz384/py3TranslateLLM/wiki/fairseq-Installation-Guide
:: This script assumes:
:: 1) Python has been downloaded and extracted to "Python38" or a similar folder name. Update the pythonDir below with the actual version.
:: 2) fairseq has already been downloaded, extracted and is available at "fairseq".
:: To clone fairseq:
:: git.exe clone https://github.com/facebookresearch/fairseq
:: 3) The ninja build system is available somewhere in %path%.
:: https://ninja-build.org/
:: 4) This also assumes the Visual Studio C++ 14.0/2015 Build Tools have been installed and are available.
@gdiaz384
gdiaz384 / installKubuntu2204.sh
Last active July 17, 2023 13:21
This script attempts to semi-automate installing Ubuntu/Kubuntu with Full Disk Encryption (FDE) in GPT/UEFI mode.
#!/bin/bash
#Description: This script attempts to semi-automate installing Ubuntu/Kubuntu with Full Disk Encryption (FDE) in GPT/UEFI mode. This script is intended to work together with the GUI and some user interaction.
#Background: FDE means that /boot is also encrypted. By default, the Graphical User Interface (GUI) only supports encrypting the lvm partition which leaves binary files exposed. There is no security benefit to having a larger attack surface.
#Credits: Based on https://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019
#Changes: reduced amount of user interaction, removed swap lvm partition, increased partition sizes
#Bugs: Only works for Ubuntu/Kubuntu version 2204. It should be possible to backport it to previous LTS versions by updating the strings used in creating/detecting lvm volumes.
#Sometimes the GRUB installer refuses to install. Known workarounds: Unknown.
#Sometimes the system will kernel panic after login. Known workarounds: Boot in native UEFI mode.
@gdiaz384
gdiaz384 / node_http-server.txt
Last active February 18, 2019 17:22
setting up an HTTP static file server
#Github: https://github.com/indexzero/http-server
#npmjs: https://www.npmjs.com/package/http-server
#become root
sudo su -
#install Node.js and its package manager "npm"
apt-get install node npm -y #Raspian
apt-get install node -y #Ubuntu
yum install nodejs npm #Fedora 21
@gdiaz384
gdiaz384 / crontab.e
Last active July 17, 2023 00:51
crontab -e example
# SSH daemon
@reboot /usr/sbin/sshd -p 22
# HTTP file server
@reboot sudo /usr/bin/nodejs /usr/local/bin/http-server /home/pi/Public --no-dotfiles -p 8080
@daily sudo pkill node && sudo /usr/bin/nodejs /usr/local/bin/http-server /home/pi/Public --no-dotfiles -p 8080
# TLS proxy and authentication on port 443
@reboot /etc/init.d/stunnel4 start
@daily sudo /home/pi/stunnel/certbot-auto renew --allow-subset-of-names --standalone --rsa-key-size 4096 --preferred-challenges tls-sni-01 --no-self-upgrade --non-interactive --agree-tos --quiet --email your.email@example.invalid --pre-hook "sudo service stunnel4 stop" --post-hook "sudo service stunnel4 start"
@gdiaz384
gdiaz384 / .rtorrent.rc
Created July 21, 2017 19:27
rtorrent configuration example
# -- START HERE --
encoding.add = utf8
#directory config
directory.default.set = /home/user/torrents/downloads
session.path.set = /home/user/.sessions/
schedule = watch_directory,5,5,load.start=/home/user/rwatch/*.torrent
execute.nothrow = chmod,777,/home/user/.config/rpc.socket
execute.nothrow = chmod,777,/home/user/.sessions
@gdiaz384
gdiaz384 / crunchy-xml-decoder_install_instructions.txt
Last active September 15, 2017 22:50
crunchy-xml-decoder Install Instructions
install python 2.7.x (https://www.python.org/downloads/release/python-2713/, add to path + compile)
install git or DL the portable version https://git-scm.com/download/win (Do not download the .zip from the webpage, the CRL line endings will be wrong.)
log out and log back to update the %path% enviornmental variable
windows key + cmd + enter
cd ~
mkdir Documents\GitHub
cd Documents\GitHub
set gitexe=C:\Users\Public\Downloads\PortableGit-2.14.1-64-bit.7z\bin\git.exe
"%gitexe%" clone clone https://github.com/jaw20/Crunchyroll-XML-Decoder.g
or
@gdiaz384
gdiaz384 / SettingUpAnXDCCServer.txt
Created October 23, 2016 15:55
Setting Up An XDCCServer on Debian
These are merged instructions from:
http://kasumi.moe/xdccguide
and
http://iroffer.dinoex.net/INSTALL-linux-en.html
::XDCC server (on debian)
sudo apt-get
sudo apt-get install make gcc libc-dev libcurl4-openssl-dev libgeoip-dev libssl-dev ruby libruby aria2
cd ~