Skip to content

Instantly share code, notes, and snippets.

View albert-xe.py
# -*- coding: utf-8 -*-
from albertv0 import *
import urllib.request
from urllib.error import URLError
import re
__iid__ = "PythonInterface/v0.1"
__prettyname__ = "XE"
__version__ = "0.0.1"
__trigger__ = "xe "
View filename_randomizer.py
import os
import random
import string
this_file = os.path.basename(__file__)
for root, dir, files in os.walk(os.path.dirname(__file__)):
for file in files:
if file != this_file:
base_name, ext = os.path.splitext(file)
View ts3server.service
# put in /etc/systemd/system directory
[Unit]
Description=TeamSpeak 3 Server
After=network.target
[Service]
WorkingDirectory=/opt/teamspeak3
User=yigit
Group=yigit
View GCC Alternatives
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 20
update-alternatives --config gcc
@ozen
ozen / Recovery RW Mount
Created Jun 22, 2016
Mounting partition in R/W mode in Ubuntu Recovery root shell
View Recovery RW Mount
mount -o remount,rw /
@ozen
ozen / Selenium PhantomJS Python Header.py
Last active Sep 8, 2020
How to set request headers when using Selenium Python with PhantomJS driver
View Selenium PhantomJS Python Header.py
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
desired_capabilities = DesiredCapabilities.PHANTOMJS.copy()
desired_capabilities['phantomjs.page.customHeaders.User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) ' \
'AppleWebKit/537.36 (KHTML, like Gecko) ' \
'Chrome/39.0.2171.95 Safari/537.36'
driver = webdriver.PhantomJS(desired_capabilities=desired_capabilities)
View TeamSpeak Upstart Script
# description "Start and stop the TS server"
console log
exec start-stop-daemon -S --chuid yigit -x /opt/teamspeak3/ts3server_minimal_runscript.sh dbplugin=ts3db_mysql
start on runlevel [2345] and started mysql
stop on runlevel [^2345]
respawn
View json color codes
[{
"rgb": [93, 138, 168],
"lab": [55.41192892871888, -7.127665665440985, -20.662310657392567],
"label": "Air Force blue"
}, {
"rgb": [240, 248, 255],
"lab": [97.17890760827636, -1.3430979525985154, -4.273119139608905],
"label": "Alice blue"
}, {
"rgb": [227, 38, 54],
View Ubuntu Locale Fix
#!/usr/bin/env bash
locale-gen en_US en_US.UTF-8 tr_TR tr_TR.UTF-8
dpkg-reconfigure locales
@ozen
ozen / DeathAdder Speed Ubuntu
Last active Apr 29, 2017
Mouse Speed at Linux
View DeathAdder Speed Ubuntu
#!/usr/bin/env bash
xinput --set-prop "Razer Razer DeathAdder" "Device Accel Constant Deceleration" 2
You can’t perform that action at this time.