Wednesday, July 18, 2012

Using S3Cmd on Windows

1) Setup python 2.x - Python 3 is not supported.
2) Download s3cmd from www.s3tools.org
3) Add python directory to your global path (should be C:\python2x)
4) Run python setup.py install
5) Run python s3cmd --configure (from the build path)

You can edit the values in the setup configuration at c:\Users\"username"\AppData\Roaming\ in a file called s3cmd.ini

I'm using s3 with Greenqloud and if you download a the tarball from them you can replace the contents s3cmd.ini with _s3cfg from Greenqloud.
Then you can run commands
python s3cmd ls
Comment below if you run into trouble, I could try to help.

Adding permanently to path in Windows through console.

path=%PATH%;C:\cygwin\bin\
setx path "%PATH%"


where C:\cygwin\bin is the addition to the current path.

Friday, April 27, 2012

Simple way to backup code, zip and copy to dropbox

Download 7zip, add it to the path (or just copy the program files to C:\windows\)
Create a .bat file containing
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b)
echo %mydate%_%mytime%
md C:\temp\%mydate%_%mytime%
robocopy C:\myfoldertobackup\ C:\temp\%mydate%_%mytime%\ *.cs *.js *.aspx *.ascx *.master *.csproj *.sln *.bat *.html *.htm *.css *.sql /s
7z a c:\temp\dropbox\codebackup\codebackup_%mydate%_%mytime%.zip C:\temp\%mydate%_%mytime%
rmdir C:\temp\%mydate%_%mytime%\ /Q /S

Run it.
I would recommend dropbox or something similiar to upload the files to somewhere safe.
Be careful with the rmdir command, make sure you don't delete anything of value.

Wednesday, March 21, 2012

Pause in dos (.bat files)

For any MS-DOS or Windows version with a TCP/IP client, PING can be used to delay execution for a number of seconds.
If specified (-w switch), PING will wait for a number of milliseconds between two pings before giving a time-out.

PING 1.1.1.1 -n 1 -w 60000 >NUL

Tuesday, March 20, 2012

Automatic submit on enter on input type=text ?

Depending on the browser, the Enter key may only cause a form submission if the form has exactly one text field, or only when there is a submit button present. The interface should not rely on a particular behavior for this key unless the issue is forced by observing the keypress event for presses of the Enter key.

so fix is add this
" input type="text" id="Text1" style="display:none;" /"

Friday, February 10, 2012

How to clone an entry in Filezilla Server.xml (create users from c#)

XDocument doc = XDocument.Load(pathtoxml);

XElement templatenode = doc.Descendants("User").SingleOrDefault(p => p.Attribute("Name").Value == "templateuser");

XElement newnode = new XElement(templatenode);
newnode.Attribute("Name").Value = "newusername";

templatenode.AddAfterSelf(newnode);

doc.Save(pathtoxml);

Will create a clone of templateuser

Friday, May 27, 2011

Monday, April 18, 2011

Macarena

Sunday, April 10, 2011

Saturday, April 9, 2011

Q: "Doctor, before you performed the autopsy, did you check for
a pulse?"
A: "No."
Q: "Did you check for blood pressure?"
A: "No."
Q: "Did you check for breathing?"
A: "No."
Q: "So, then it is possible that the patient was alive when you
began the autopsy?"
A: "No."
Q: "How can you be so sure, Doctor?"
A: "Because his brain was sitting on my desk in a jar."
Q: "But could the patient have still been alive nevertheless?"
A: "It is possible that he could have been alive and practicing
law somewhere."

Sunday, April 3, 2011

Gustave Gilbert - Wikipedia, the free encyclopedia

Nuremberg trials

Göring: Why, of course, the people don't want war. Why would some poor slob on a farm want to risk his life in a war when the best that he can get out of it is to come back to his farm in one piece? Naturally, the common people don't want war; neither in Russia, nor in England, nor in America, nor for that matter in Germany. That is understood. But, after all, it is the leaders of the country who determine the policy and it is always a simple matter to drag the people along, whether it is a democracy, or a fascist dictatorship, or a parliament, or a communist dictatorship.
Gilbert: There is one difference. In a democracy the people have some say in the matter through their elected representatives, and in the United States only Congress can declare wars.
Göring: Oh, that is all well and good, but, voice or no voice, the people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked, and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country.

Saturday, April 2, 2011

Friday, March 25, 2011

Thursday, March 24, 2011

Saturday, March 5, 2011

Saturday, February 26, 2011

Jaws

If you watch the movie `Jaws' backwards, it's a movie about a shark that keeps throwing up people until they have to open a beach.

TIL there are 100+ octillion moves in chess | Braincrave.com... where minds meet

TIL there are 100+ octillion moves in chess | Braincrave.com... where minds meet: "there are 169,518,829,100,544,000,000,000,000,000 (approximately 1.70 x 10^29) ways to play the first ten moves in chess."

Saturday, February 19, 2011

flags

Tuesday, February 15, 2011

Monsanto - Wikipedia, the free encyclopedia

Monsanto - Wikipedia, the free encyclopedia: "As of May 2008, Monsanto is currently engaged in a campaign to prohibit dairies which do not inject their cows with artificial bovine growth hormone from advertising this fact on their milk cartons.[24]"

Spy Games: Inside the Convoluted Plot to Bring Down WikiLeaks | Threat Level | Wired.com

Spy Games: Inside the Convoluted Plot to Bring Down WikiLeaks | Threat Level | Wired.com: "In October 2010, HBGary CEO Greg Hoglund had tossed out a random idea for Barr, one that did not apparently seem unusual: “I suggest we create a large set of unlicensed windows-7 themes for video games and movies appropriate for middle east & asia. These theme packs would contain back doors.”"

With a line like that, i just had to buy it. - Imgur

With a line like that, i just had to buy it. - Imgur

Susan G. Komen for the Cure - Wikipedia, the free encyclopedia

Susan G. Komen for the Cure - Wikipedia, the free encyclopedia: "more than a hundred small charities have received legal opposition from Komen to varied uses of 'for the cure' in their names, at a cost of nearly one-million dollars per year in donor funds"

Defector admits to WMD lies that triggered Iraq war | World news | The Guardian

Defector admits to WMD lies that triggered Iraq war | World news | The Guardian: "The defector who convinced the White House that Iraq had a secret biological weapons programme has admitted for the first time that he lied about his story"

Monday, February 14, 2011

Sunday, February 13, 2011

List of fictional television shows - Wikipedia, the free encyclopedia

List of fictional television shows - Wikipedia, the free encyclopedia: "Bobcat or Björk - game show in which contestants must figure out if a three-second sound bite is comedian Bobcat Goldthwait or singer Björk Guðmundsdóttir."





Saturday, February 12, 2011

Sex On Mars & Mars Pregnancy Risks | Mars Colonization, Space Exploration | Space Radiation | Space.com

Sex On Mars & Mars Pregnancy Risks | Mars Colonization, Space Exploration | Space Radiation | Space.com: "Radiation spoils space sex"

mQK0K.jpg (720×540)

E-mails from an Asshole

E-mails from an Asshole: "or London on business and need to sublet my studio apartment immediately. It is a beautiful spacious apartment in the East Village (near Tompkins Square Park)"

Wednesday, February 9, 2011

Tuesday, February 8, 2011

Mayor of Detroid speaks up

@ There are not any plans to erect a statue to Robocop. Thank you for the suggestion.
Twitter / @Mayor Dave Bing: @MT There are not any plan ...

Saturday, February 5, 2011

Should robots have rights? : philosophy

Should robots have rights? : philosophy: "At what point do we say, 'here is a level of intelligence worthy of rights?'
I'll go with the level of intelligence where when you deny said entity rights it can start to plot against you."

Friday, February 4, 2011

406 F.3d 857

406 F.3d 857: "On the evening of May 29, 2003, Hayden was smoking crack with three other folks at a trailer park home on Chain of Rocks Road in Granite City, Illinois, Murphy, Sr., who had sold drugs to Hayden several years earlier, showed up later that night. He was friendly at first, but he soon called Hayden a 'snitch bitch hoe'" (1)
*snip*

1: The trial transcript quotes Ms. Hayden as saying Murphy called her a snitch bitch "hoe." A "hoe," of course, is a tool used for weeding and gardening. We think the court reporter, unfamiliar with rap music (perhaps thankfully so), misunderstood Hayden's response. We have taken the liberty of changing "hoe" to "ho," a staple of rap music vernacular as, for example, when Ludacris raps "You doin' ho activities with ho tendencies."

via reddit.