This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTITY="$USER/.ssh/identity.pem" | |
SRC_PORT=19999 | |
DST_PORT=22 | |
DST_USER=gandalf | |
DST_HOST=120.88.7.11 | |
autossh -M 0 -N -o ServerAliveInterval 15 -i $IDENTITY -R $SRC_PORT:localhost:$DST_PORT $DST_USER@$DST_HOST | |
## You can connect back from DST_HOST using ssh -p $SRC_PORT local_user_on_SRC@localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
b=$(xrandr --current --verbose | grep -i bright | cut -d':' -f 2) | |
b=$((b + 0.1)) | |
xrandr --output eDP-1 --brightness $b ## adjust the output with yours, you can get it using the commend xrandr (with no args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
b=$(xrandr --current --verbose | grep -i bright | cut -d':' -f 2) | |
b=$((b - 0.1)) | |
xrandr --output eDP-1 --brightness $b ## adjust the output with yours, you can get it using the commend xrandr (with no args) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i3-msg reload | |
i3-msg restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for c in $(i3-msg -t get_bar_config | python -c \ | |
'import json,sys;print("\n".join(json.load(sys.stdin)))'); do \ | |
(i3bar --bar_id=$c >i3bar.$c.log 2>&1) & \ | |
done; | |
cat i3bar.bar-*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description="Establish a SSH tunnel to orion to map searx port to local 3337" | |
After=sshd.service | |
StartLimitIntervalSec=0 | |
[Service] | |
Type=simple | |
Restart=Always | |
RestartSec=1 | |
User=yfe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code is written at BigVision LLC. It is based on the OpenCV project. It is subject to the license terms in the LICENSE file found in this distribution and at http://opencv.org/license.html | |
# Usage example: python3 object_detection_yolo.py --video=run.mp4 | |
# python3 object_detection_yolo.py --image=bird.jpg | |
import cv2 as cv | |
import argparse | |
import sys | |
import numpy as np | |
from urllib.request import urlopen | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DISK_IMAGE=~/Downloads/my-image.img | |
DISK=/dev/sdK | |
pv $DISK_IMAGE | sudo dd bs=4M of=$DISK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pre-conditions | |
-------------- | |
- The following packages must be installed on both ends: gpg, xxd. | |
- Sender and Receiver must know the password to encrypt/decrypt the data. | |
Sender | |
------ | |
$ gpg --symmetric $FILE_TO_SEND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl enable sshd ; systemctl start sshd | |
# select relevant servers in /etc/pacman.d/mirrorlist according to your location | |
# initialise keyring | |
pacman-key --init | |
# initial setup of keys | |
pacman-key --populate archlinux | |
# update everything (should be done regularly) | |
pacman -Sy archlinux-keyring && pacman -Su |