Skip to content

Instantly share code, notes, and snippets.

Bharadwaj Raju bharadwaj-raju

Block or report user

Report or block bharadwaj-raju

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
@bharadwaj-raju
bharadwaj-raju / panel-alpha.sh
Created Aug 13, 2016
changes panel transparency depending on whether any window is maximized or not
View panel-alpha.sh
#!/usr/bin/env bash
#-- CONFIGURATION
transparent_alpha=0
maximized_alpha=100
interval=0
#--
alpha_prop_list=()
for prop in $(xfconf-query -c xfce4-panel -p /panels -l); do
@bharadwaj-raju
bharadwaj-raju / database.py
Last active Jan 6, 2018
Simple "database" class in Python -- basically a dict which can load-from/write-to disk without you manually calling json.load()/json.dump()
View database.py
import json
class DataBase(object):
def __init__(self, path):
self.path = path
self.load()
View README.md
@bharadwaj-raju
bharadwaj-raju / crypt.py
Created Oct 23, 2017
Simple AES enc/dec python
View crypt.py
import struct
from Crypto.Cipher import AES
def pad16(s):
t = struct.pack('>I', len(s)) + s.encode('utf-8')
return t + b'\x00' * ((16 - len(t) % 16) % 16)
def unpad16(s):
n = struct.unpack('>I', s[:4])[0]
return s[4:n + 4]
@bharadwaj-raju
bharadwaj-raju / gmailChecker.py
Last active Apr 10, 2017
Python script/module to check for unread Gmail messages
View gmailChecker.py
import imaplib
import re as regex
def getGmailUnread(username, password):
gmail = imaplib.IMAP4_SSL('imap.gmail.com','993')
gmail.login(username,password)
gmail.select()
unreadCount = regex.search("UNSEEN (\d+)", gmail.status("INBOX", "(UNSEEN)")[1][0]).group(1)
View kde_bug_demo_2017-03-18.png
�PNG

IHDRA���R pHYs���+ IDATx��w\����5�NzPAA���cK�
;�Xbb/��5�(h�]�'E��p�;�ë;�?��w'��|?��ev�M�7�f���~����@��� ���߈
��`�*4G>�o�}� ���:��J#��t�4&B� ���c���Mӂ�`0j|�a𓏯$�;#��
���`L���+!u���?���[<�b0�W�n�������W_A c,H��~�1���*����s�V&��|����?&I��
Y���k`r�����]��0%[C%bZX1�!J�V!+�f󕢩�_��c���b!�E���C�L_�Q!HߣϽ-ŰEE!�J_��}��C�Q`��7�aU����`̂��ù����gϞ;{�zH�����������C�JB���f�]ZiS5�1x�MC�Me�=�d� ������N�А=�_�~��gm�Hhj�JU]�:�t?����V�!ݻ���,J�;�������?���C� �=`�B29�
&�PJxo�Ed�������+AT�y�gΈ>엪-�񸸸\J��`0��s�� ��b���ǦUhȜٳ��ܘLf߾��Ǐ#I��1�nQ/� L�_߆G��R|c�b����E�V�!�g�rwsc0�}�Qu]�L�zA����}��7����n��2+�R� ��I/7š(x�B\&�H%e�{w>=�SB��U���?7o��/;++��
��v�I�T�j��@�EQ����<w�<Q
@bharadwaj-raju
bharadwaj-raju / looper.py
Created Mar 16, 2017
Python program loop
View looper.py
import sys
while True:
# code here
print('Do you want to start the program again? (Y/N)')
response = input('> ').strip().upper()
if response == 'Y':
pass
else:
@bharadwaj-raju
bharadwaj-raju / README.md
Last active Mar 5, 2017
simple python fileserver with authentication
View README.md

fileserver.py

Credit to bones7456.

Instructions

Change values in settings.py, place it in the same directory as fileserver.py then run python2 fileserver.py

View desktop-to-debian-menu.py
#!/usr/bin/env python3
import sys
import os
def parse_xdg_desktop(desktop_file_or_string):
'''Parse a .desktop file.
Parse an XDG .desktop file or a string with its contents into an easy-to-use dict, with standard values present even if not defined in file.
You can’t perform that action at this time.