
Sunday, May 10, 2009
paramiko to sftp without keys
Stupid server does not allow installation of ssh keys. This makes file transfers harder to automate from a cron job for example because scp and ssh have no --username --passwd options.
Python can help! I can sftp a whole dir of files to the sftp server with this script. My next task is to make paramiko accept filename extention wildcards. i.e. 'sftp *.csv mucknuck@sftp.computrid.com:'
import paramiko
import os
hostname = 'sftp.computrid.com'
port = 22
username = 'nucknuck'
password = '05N9289!'
dir_path = 'moo'
local_path = '/home/datasvcs/AIG/moo'
if __name__ == "__main__":
t = paramiko.Transport((hostname, port))
t.connect(username=username, password=password)
sftp = paramiko.SFTPClient.from_transport(t)
files = os.listdir(local_path)
for f in files:
print 'Uploading', f
sftp.put(os.path.join(dir_path, f), f)
t.close()
Python can help! I can sftp a whole dir of files to the sftp server with this script. My next task is to make paramiko accept filename extention wildcards. i.e. 'sftp *.csv mucknuck@sftp.computrid.com:'
import paramiko
import os
hostname = 'sftp.computrid.com'
port = 22
username = 'nucknuck'
password = '05N9289!'
dir_path = 'moo'
local_path = '/home/datasvcs/AIG/moo'
if __name__ == "__main__":
t = paramiko.Transport((hostname, port))
t.connect(username=username, password=password)
sftp = paramiko.SFTPClient.from_transport(t)
files = os.listdir(local_path)
for f in files:
print 'Uploading', f
sftp.put(os.path.join(dir_path, f), f)
t.close()
Sunday, March 15, 2009
reset OS X Leopard user's video mode
This hackintosh of mine is a trip. When logged in as an ordinary user I ask Leopard to use a video mode not of its choosing. The screen turns blue and fails to revert back to the previous setting. Perhaps if I had an Apple LCD display it would behave differently but I doubt it. I rebooted the machine from an ssh login and tried to login as the same user who had the blue screen. Guess what? I login and the screen turns blue and stays that way.
Anyway to expunge the broken setting all you need do is ssh into the stricken user's account and:
cd /Users/msh/Library/Preferences/ByHost
rm com.apple.preference.displays.*
rm com.apple.windowserver.*
Lemme know if this works for you.
Anyway to expunge the broken setting all you need do is ssh into the stricken user's account and:
cd /Users/msh/Library/Preferences/ByHost
rm com.apple.preference.displays.*
rm com.apple.windowserver.*
Lemme know if this works for you.
Friday, January 9, 2009
Body of Lies
Blah. Dumb movie. I couldn't sympathize with any of the characters. The one bright spot is Golshifteh Farahani as Aisha. She could melt an iceberg with those eyes. Then again, the idea that she would date DiCaprio's dodgy character is pretty far fetched. DiCaprio will only tell her is that he's a "political advisor to the King." nplz. Aisha would be deeply suspicious, and rightly so. Also, women as pretty as Farahani (especially in a traditional society) always have men chasing them so where are her would-be suitors? If DiCaprio had a run-in with some Arab guy over her my willingness to suspend disbelief might have lasted a bit longer.
Oh yeah, the fake Middle Eastern soundtrack is nauseating.
Note to Hollywood. Stop making movies about Arab terrorists. You suck at this.
Oh yeah, the fake Middle Eastern soundtrack is nauseating.
Note to Hollywood. Stop making movies about Arab terrorists. You suck at this.
Thursday, January 1, 2009
The Spartan
http://www.imdb.com/title/tt0360009/
This movie is the shit. It has a great cast, superb dialog and it's full of twists you can't anticipate. I like movies that don't varnish their characters too much. These characters, especially Kilmer's, are deeply focused on their missions. You rarely get to see them as their private selves. As with other Mamet joints, the characters declare their intentions in blunt, Hemingwayesque fashion. Nobody mumbles; nobody minces words. Any one of them has more nerve than the rest of us combined.
I'll give it 9 of 10 dongs.
This movie is the shit. It has a great cast, superb dialog and it's full of twists you can't anticipate. I like movies that don't varnish their characters too much. These characters, especially Kilmer's, are deeply focused on their missions. You rarely get to see them as their private selves. As with other Mamet joints, the characters declare their intentions in blunt, Hemingwayesque fashion. Nobody mumbles; nobody minces words. Any one of them has more nerve than the rest of us combined.
I'll give it 9 of 10 dongs.
Sunday, December 14, 2008
The Band's Visit
Great date movie. Not that I'd know what a date is.
I was expecting something silly or corny. But it wasn't like that at all. It felt true and honest.
I was expecting something silly or corny. But it wasn't like that at all. It felt true and honest.
Thursday, December 11, 2008
Teacher Threatens Linux Advocate
Ignorant public school teacher threatens to call the cops on FOSS advocate for handing out Linux DVDs.
Linux Is Corrupting Our Youth!
Teachers are supposed to be well informed and open to new ideas.
Being aware of FOSS should not be considered some kind of esoteric knowledge. It should be akin to knowing that your diesel truck can burn biodiesel as well as petrochemical diesel. Then again I'm sure there are plenty of people in this country who know what biodiesel is but would never use it even if it was half the price of petro diesel. We the sheeple.
This reminds me of the jackass legislator in OK who threatened to call the FBI on CentOS when he discovered the default CentOS Apache "it worked!" page running on a server where he expected to see something else. He knew immediately that the server had been hacked and lurched into action.
Linux Is Corrupting Our Youth!
Teachers are supposed to be well informed and open to new ideas.
Being aware of FOSS should not be considered some kind of esoteric knowledge. It should be akin to knowing that your diesel truck can burn biodiesel as well as petrochemical diesel. Then again I'm sure there are plenty of people in this country who know what biodiesel is but would never use it even if it was half the price of petro diesel. We the sheeple.
This reminds me of the jackass legislator in OK who threatened to call the FBI on CentOS when he discovered the default CentOS Apache "it worked!" page running on a server where he expected to see something else. He knew immediately that the server had been hacked and lurched into action.
Subscribe to:
Posts (Atom)