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
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
sudo dd if=inputfile.iso of=/dev/disk<?> bs=4M && sync |
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
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.common.exceptions import WebDriverException | |
import os | |
import time | |
class Website(webdriver.Firefox): | |
def connect(self, user=os.environ['USERNAME'], password=os.environ['PASSWORD']): | |
self.get("https://www.example.com/login") |
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
curl https://www.instagram.com/USERNAME/ | grep 'window._sharedData = ' | python -c 'print(input()[64:-10])' | jq |
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
git config --global core.editor "emacs -nw" |
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
""" | |
Scrap caption and images from instagram using https://deskgram.org | |
""" | |
import requests | |
from bs4 import BeautifulSoup | |
BASE_URL = 'https://deskgram.org' | |
USER = 'healthymealsberlin' | |
start_url = BASE_URL + '/' + USER |
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
def create_app(): | |
""" | |
Create Flask application using the app factory pattern. | |
:return: Flask app | |
""" | |
app = Flask(__name__, instance_relative_config=True) | |
app.config.from_object('config.settings') |
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
import json | |
import requests | |
from bottle import debug, request, route, run | |
GRAPH_URL = "https://graph.facebook.com/v2.6" | |
VERIFY_TOKEN = 'YOUR_VERIFY_TOKEN' | |
PAGE_TOKEN = 'YOUR_PAGE_TOKEN' | |
def send_to_messenger(ctx): |