Skip to content

Instantly share code, notes, and snippets.

😇
C is so fun!

Vahid pylover

😇
C is so fun!
Block or report user

Report or block pylover

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View kde_bluetooth_workaround_script
#!/bin/sh
device_mac='<your-devices-mac-address-here>'
pacmd set-card-profile `pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}'` off
sleep 2
echo "disconnect $device_mac\n quit"|bluetoothctl
sleep 5
echo "connect $device_mac\n quit"|bluetoothctl
@pylover
pylover / default.conf
Created Jan 29, 2017 — forked from szarapka/default.conf
NGiNX Configuration for Vue-Router in HTML5 Mode
View default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
View genpasslist.py
#!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser(description='Generate password list')
parser.add_argument('-s', '--start', default=0, type=int, help='start number')
parser.add_argument('-e', '--end', default=1000, type=int, help='end number')
parser.add_argument('-p', '--prefix', default='', help='the prefix will be append to start of each item')
parser.add_argument('-s', '--suffix', default='', help='the suffix will be append to end of each item')
parser.add_argument('-z', '--zero-padded', default=0, type=int, help='zero padded.')
@pylover
pylover / a2dp.py
Last active Aug 23, 2019
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
View a2dp.py
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
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 .
@pylover
pylover / inspections.txt
Last active Aug 4, 2019 — forked from ar45/inspections.txt
PyCharm inspections
View inspections.txt
# 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 / build-python3.5.sh
Last active Jul 8, 2018
Building python3.5 on jessie
View build-python3.5.sh
#! /bin/bash
sudo apt-get build-dep python3.4
sudo apt-get install build-essential libncursesw5-dev libreadline6-dev libssl-dev \
libgdbm-dev libc6-dev libsqlite3-dev tk-dev sqlite3
./configure --enable-shared
make -j4
sudo make altinstall
@pylover
pylover / ssh-vpn.py
Last active Dec 19, 2018
Python script to make layer 3 VPN using openssh
View ssh-vpn.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SSH VPN using pure python and openssh-client/server
Server configurations:
* Enable ip forwarding. (linux: /etc/sysctl.conf)
* Enable tunnel in openssh server config file: $ echo "PermitTunnel yes" >> /etc/ssh/sshd_config
@pylover
pylover / null_tunnel.py
Last active Dec 19, 2018
Multi-thread TCP port forwarder using pure python.
View null_tunnel.py
#!/usr/bin/env python
"""
ChangeLog:
[2015-04-14] 0.1.1
* Changing `IP Address` to `HOST` in command line help
* Program name changed to `null_tunnel`
* Test case was provided
[2015-04-15] 0.2.0
You can’t perform that action at this time.