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
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
# Make sure you have IMAP enabled in your gmail settings. | |
# Right now it won't download same file name twice even if their contents are different. | |
import email | |
import getpass, imaplib | |
import os | |
import sys | |
detach_dir = '.' |
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
Installing Arch: | |
sudo vim /etc/pacman.conf | |
Update packages list: sudo pacman -Syy | |
run sudo pacman -Syu before installing any software (to update the repositories first) | |
* Timing issue: | |
- Change hardware clock to use UTC time: | |
sudo timedatectl set-local-rtc 0 |
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
""" | |
=========== | |
Description | |
=========== | |
Simple script to copy and gzip static web files to an AWS S3 bucket. S3 is great for cheap hosting of static web content, but by default it does not gzip CSS and JavaScript, which results in much larger data transfer and longer load times for many applications | |
When using this script CSS and JavaScript files are gzipped in transition, and appropriate headers set as per the technique described here: http://www.jamiebegin.com/serving-compressed-gzipped-static-files-from-amazon-s3-or-cloudfront/ | |
* Files overwrite old versions |
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
#!/usr/bin/env python | |
# coding:utf-8 | |
import pykka | |
import threading | |
import signal | |
import time | |
import sys | |
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 asyncio | |
import time | |
def timeit(func): | |
async def process(func, *args, **params): | |
if asyncio.iscoroutinefunction(func): | |
print('this function is a coroutine: {}'.format(func.__name__)) | |
return await func(*args, **params) | |
else: |
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
#!/usr/bin/env python3 | |
import Xlib.threaded | |
import Xlib | |
import Xlib.display | |
from Xlib import Xatom | |
from PIL import Image | |
import os.path | |
from collections import defaultdict | |
try: |
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 nameko.standalone.rpc import ClusterRpcProxy | |
config = { | |
'AMQP_URI': 'amqp://guest:guest@localhost:5672/' | |
} | |
with ClusterRpcProxy(config) as rpc: | |
session_token = rpc.auth.login("admin", "secret") | |
with ClusterRpcProxy(config, context_data={'session': session_token}) as rpc: |
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 subprocess import Popen, PIPE, call | |
import logging | |
import logging.handlers | |
import sys | |
import os | |
# NOTE: this script assumes a debian system and requires the wmctrl and xdotool packages | |
# sudo apt-get install wmctrl xdotool | |
# NOTE: To get [Alt + ` ]to register on Elementary OS requires removing the keybinding via dconf editor for switch-group/switch-group-backward |
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
# -*- coding: latin-1 -*- | |
# Copy this python script under ~/.local/share/nautilus-python/extensions and restart nautilus. | |
# You may need to create nautilus-python and extensions folders if they do not exist. – | |
import os | |
import gi | |
gi.require_version('Nautilus', '3.0') | |
from gi.repository import Nautilus, GObject |
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 | |
setting=$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled) | |
if [[ $setting == "true" ]]; then | |
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false | |
else | |
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true | |
fi |
OlderNewer