Skip to content

Instantly share code, notes, and snippets.

View prashanta's full-sized avatar
🚀

Prashanta Shrestha prashanta

🚀
View GitHub Profile
@prashanta
prashanta / Terminal-Finder-Switcher
Created July 4, 2010 22:29
Switching between Terminal and Finder
set a to item 1 of getFrontApp()
if a contains "Finder" then
tell application "Finder"
set the_folder to (folder of the front window) as text
set the_folder to POSIX path of the_folder
set the_folder to (do shell script "echo " & the_folder & " | sed 's/ /\\\\ /g'")
end tell
tell application "Terminal"
do script "cd " & the_folder & ";clear;pwd"
activate
set applist to getFrontApp()
-- screen resolution
set screen to {1280, 800}
set menubar to getMenuSize()
set dock to getDockSize()
set a to item 1 of getFrontApp()
set t to (item 2 of menubar)
set l to 0
set h to 600
# Python script to find missing lines from two different files
import sys
import string
if len(sys.argv) < 4:
print "Usage: findmissing.py <master-file> <test-file> <result-file>"
sys.exit()
else:
file1 = sys.argv[1];
javascript:(function(){ window.open('https://mail.google.com/tasks/canvas','myWindow', 'status=1, height=600,width=600,resizable = 0,location=0'); })();
@prashanta
prashanta / pssh.py
Created January 21, 2010 07:05
SSH connection from Python
import paramiko
import string
import webbrowser
import os
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('192.168.1.21', username='username', password='password')
print "1: get file \n2: print contents of file"
$ sudo aptitude update && sudo aptitude install gnome-do