Skip to content

Instantly share code, notes, and snippets.

View aanari's full-sized avatar

Ali Anari aanari

View GitHub Profile
@aanari
aanari / alacritty.yml
Last active August 11, 2023 13:11
Alacritty Config (WSL)
env:
TERM: xterm-256color-italic
WSLENV: TERM
shell:
program: wsl
scrolling:
history: 10000
@aanari
aanari / brow.sh
Created October 18, 2022 19:36
Browsh Helper Script for Neomutt
#!/bin/bash
pkill -u "$(whoami)" -SIGINT firefox
pkill -u "$(whoami)" -SIGINT browsh
FILE=$(echo "$1" | sed -e 's/http:\/\/localhost:20015\/file:\/\///g')
cp "$FILE" "$HOME/.neomutt/tmp"
#HOMEDIR=$(echo $HOME | sed -e 's/\//\\\//g')
#PATTERN="s/file:\/\/$HOMEDIR\///g"
#URL=$(echo $1 | sed -e $PATTERN)
#echo $URL
browsh --startup-url http://localhost:20015/.neomutt/tmp
@aanari
aanari / install_neomutt.sh
Last active October 16, 2022 15:49
Install neomutt
# Run as root
curl -LO https://github.com/neomutt/neomutt/archive/refs/tags/20220429.zip
unzip 20220429.zip
cd neomutt-20220429
apt install xsltproc xml-core libxml2 gettext libidn11-dev libidn2-dev libxml2-utils docbook docbook-xml libgpgme-dev libsasl2-2 gnutls-bin lua5.3 liblua5.3-dev notmuch libnotmuch-dev libdb5.3-dev libdb5.3++-dev libqdbm-dev libqdbm++-dev libgdbm-dev liblmdb-dev libkyotocabinet-dev librocksdb-dev libtdb-dev libtokyocabinet-dev libl4-dev libzstd-dev
./configure --everything
make
make install
@aanari
aanari / wsl_ssh.bat
Created July 23, 2022 16:11
SSH and WSLHostPatcher
rem This starts up everything for WSL2
C:\windows\system32\wsl.exe -e exit
rem and then it starts up WSLHostPatcher
C:\"Program Files"\WSLHostPatcher\WSLHostPatcher.exe
rem Finally, it starts the SSH server
C:\windows\system32\wsl.exe -e sudo service ssh start
@aanari
aanari / remote.sh
Created July 22, 2022 15:42
SSH with clipboard sync
#!/bin/bash
# Copy this to /usr/local/bin/remote
ps cax | grep lemonade> /dev/null
if [ $? -eq 0 ]; then
echo "lemonade is running."
else
echo "lemonade is not running."
nohup lemonade server &
fi
@aanari
aanari / xclip.sh
Last active July 23, 2022 16:05
Custom xclip for clipboard sync (Local WSL 2.0, Remote SSH)
#!/bin/bash
# Copy this to /usr/local/bin/xclip
stdin="$([[ -p /dev/stdin ]] && cat -)"
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE=remote/ssh
else
case $(ps -o comm= -p "$PPID") in
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
esac
@aanari
aanari / use lemonade for remote clipboard sharing
Created July 19, 2022 05:34 — forked from bketelsen/use lemonade for remote clipboard sharing
how to use lemonade to share a clipboard between remote computers
on local and remote machine:
go get github.com/pocke/lemonade (if you have Go installed, if not download lemonade binary from github)
make sure $GOPATH/bin is in your path on both machines
-- or move $GOPATH/bin/lemonade to a place already in your path like /usr/local/bin
on your local machine add a script like this:
cat ~/bin/remote
@aanari
aanari / chadrc.lua
Last active September 18, 2023 18:36
NvChad Config
local M = {}
M.options, M.ui, M.mappings, M.plugins = {}, {}, {}, {}
M.options.tabstop = 4
M.plugins = {
status = {
neoscroll = true,
colorizer = true,
truezen = true,
@aanari
aanari / free_wsl_docker.bat
Created May 2, 2021 15:29
Free Up WSL Docker Space
wsl --shutdown
diskpart
:: open window Diskpart
select vdisk file="C:\Users\<username>\AppData\Local\Docker\wsl\data\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
exit
@aanari
aanari / fix_nomachine_auth.sh
Last active April 26, 2021 03:55
Fix Auth for NoMachine 7.X
# Run as root
cp /etc/pam.d/nx /etc/pam.d/nx.bak
cp /etc/pam.d/sshd /etc/pam.d/nx
# Depending on where nxserver binary lives:
/etc/NX/bin/nxserver –useredit <username> –administrator yes