Skip to content

Instantly share code, notes, and snippets.

@mehulved
mehulved / populate-offlineimaprc
Created May 2, 2012 08:23
This script will add users to offlineimaprc file for syncing emails
#!/usr/bin/python
userfile = open('/etc/passwd', 'r')
rcfile = open('~/.offlineimaprc','w')
entries = userfile.read().split("\n")
userfile.close()
userlist = []
content_repos = ""
@mehulved
mehulved / change-pass
Created May 1, 2012 07:07
Change password for all the users in the system
#!/usr/bin/env bash
PASS="mypass"
for USER in `awk -F: '{print $1}' /etc/passwd`
do
echo $USER:$PASS >> user_list
done
cat user_list | chpasswd
@mehulved
mehulved / gspell.py
Created March 24, 2012 20:46
Spell Checking with Google
#!/usr/bin/env python
import requests
import sys
url = "https://www.google.com/tbproxy/spell?lang=en:"
word = sys.argv[1]
xml_struct = """
<spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1">