Skip to content

Instantly share code, notes, and snippets.

View ucalyptus2's full-sized avatar
🏠
Working from home

Sayantan Das ucalyptus2

🏠
Working from home
  • Earth
View GitHub Profile
wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip -qq -n ngrok-stable-linux-amd64.zip
apt-get install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen > /dev/null
echo root:$password | chpasswd
mkdir -p /var/run/sshd
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
echo "LD_LIBRARY_PATH=/usr/lib64-nvidia" >> /root/.bashrc
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 <magnet_link>"
exit 1
fi
magnet_link="$1"
transmission-cli --download-dir=/content/ "$magnet_link"
@ucalyptus2
ucalyptus2 / simp.sh
Last active February 25, 2023 07:11
sudo apt install transmission-cli -y
curl -fsSL https://code-server.dev/install.sh | sh
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok
wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
tar zxf ngrok-v3-stable-linux-amd64.tgz
./ngrok config add-authtoken $1
@ucalyptus2
ucalyptus2 / send_across_cc_dirs.sh
Created December 25, 2022 20:55
move files from /home or /scratch to /project or vice versa, without altering the group id. Don't use cp or mv for this, instead use this.
rsync -axvH --no-g --no-p $1 $2
#rsync -axvH --no-g --no-p $HOME/mae $HOME/projects/def-amiilab/$USER/ is an EXAMPLE
#code is same for project to home/
#using this doesn't change the gid from project group to user group. project group always has more storage
#see https://docs.alliancecan.ca/wiki/Frequently_Asked_Questions#Moving_files_between_scratch_and_home_filesystems
VERSION=$1
mkdir -p ~/.local/lib ~/.local/bin
curl -fL https://github.com/coder/code-server/releases/download/v$VERSION/code-server-$VERSION-linux-amd64.tar.gz | tar -C ~/.local/lib -xz
mv ~/.local/lib/code-server-$VERSION-linux-amd64 ~/.local/lib/code-server-$VERSION
rm ~/.local/bin/code-server
ln -s ~/.local/lib/code-server-$VERSION/bin/code-server ~/.local/bin/code-server
PATH="~/.local/bin:$PATH"
(base) βœ“ [ucalyptus@ucalyptus ~] ➜ aplay /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
(base) βœ“ [ucalyptus@ucalyptus ~] ➜ sudo aplay -l
[sudo] password for ucalyptus:
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC3246 Analog [ALC3246 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
# run this below line in terminal without the !
!pip install instagrapi
######
from instagrapi import Client
cl = Client()
PROXY = "139.59.1.14:1080" #@param{type:"string"}
CRITERIA = "socks5" #@param ["https","http","socks5"]
#cl.set_proxy("{CRITERIA}://USERNAME:PASSWORD@{PROXY}") if you need a proxy , use this or else use the below line
cl.login("USERNAME", "PASSWORD")
from pathlib import Path
import fastai
from deoldify.visualize import *
import warnings
warnings.filterwarnings("ignore", category=UserWarning, message=".*?Your .*? set is empty.*?")
#NOTE: This must be the first call in order to work properly!
from deoldify import device
from deoldify.device_id import DeviceId
#choices: CPU, GPU0...GPU7
device.set(device=DeviceId.GPU0)
import torch
if not torch.cuda.is_available():
print('GPU not available.')