Skip to content

Instantly share code, notes, and snippets.

View pylover's full-sized avatar

Vahid pylover

View GitHub Profile
@pylover
pylover / hanoi-towers.py
Last active December 7, 2022 16:57
Tower of Hanoi using Python3
#! /usr/bin/env python3
"""
Move: 65536
| | |
| | 1
| | 2
| | 3
@pylover
pylover / install-gitea.sh
Created November 19, 2022 18:18
Script to install Gitea on Ubuntu 20.04
#! /usr/bin/env bash
set -e
UNAME=git
# Obtain some information
APPNAME=""
read -p "Enter application title: " APPNAME
@pylover
pylover / install-nodejs.sh
Created August 2, 2021 19:24
Install nodejs from source on FreeBsd
#! /usr/bin/env bash
# Prerequicites
pkg install gcc openssl-devel
# Clone the source
git clone [email protected]:nodejs/node.git -b v16.x --depth 1
# Configure and Build
@pylover
pylover / a2dp.py
Last active August 11, 2024 06:11
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@pylover
pylover / inspections.txt
Last active December 26, 2024 15:42 — forked from ar45/inspections.txt
PyCharm inspections
# Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |'
# noinspection PyPep8
# noinspection PyPep8Naming
# noinspection PyTypeChecker
# noinspection PyAbstractClass
# noinspection PyArgumentEqualDefault
# noinspection PyArgumentList
# noinspection PyAssignmentToLoopOrWithParameter
# noinspection PyAttributeOutsideInit
@pylover
pylover / ssh-tun-freebsd.sh
Last active June 10, 2023 10:57
SSH TUN/TAP for various platforms.
#! /usr/bin/env bash
HOST=example.com
USER=alice
LTUN=0
RTUN=3
LADDR=192.168.2.4/31
RADDR=192.168.2.3
HOSTADDR=$(dig $HOST +short)
GW=192.168.1.1
FLAGS="-p7575 -N -v -w $LTUN:$RTUN"