Dark Launch

This is a Dark Launch.

How to run a for loop in the Terminal; wget sequence for loop

This will download a sequence of pictures from picture1.jpg to picture10.jpg from example.com:
Code
 
for i in $(seq 10); do wget "http://example.com/folder/picture$i.jpg"; done
 

How to upload a file via the command line using cURL; Upload an image using curl

To upload a file using the command line, do the following:
Code
curl "http://example.com/upload.php" -F myfile=@"/path/to/file"
 

Example:
Code
curl "http://example.com/upload.php" -F myfile=@"~/Desktop/image.png"
 

And using authentication:
Code
curl -u username:password "http://example.com/upload.php" -F myfile=@"~/Desktop/image.png"
 

NOTE:
Change myfile to the file input value name.
<input name="myfile" type="file" />
PHP
// upload.php
var_dump($_FILES);

How to format a dollar amount using PHP; money format; number_format

This will format a number into a dollar amount.

PHP
function money_format($amount) {
    return number_format($amount, 2, '.', ',');
}

Example:

PHP
$amount = 123456;
echo money_format($amount); // 123,456.00

How to remote mount with password using SSHFS and stdin; Ubuntu sshfs remote mounting; MOSSO

This will allow you to mount a remote ssh filesystem using sshfs (Secure SHell FileSystem):
Code
 
echo mypassword | sshfs myuser@ftp.mysite.com:/ ~/mounts/mysite -o workaround=rename -o password_stdin
 

Replace mypassword, myuser, ftp.mysite.com and mysite.
Example:
Code
 
echo 4ghNZGpk182q8SvY0kw021JbRb34THaPDN8wyXY679BQPSit5A | sshfs jsmith@ftp.example.com:/ ~/mounts/example -o workaround=rename -o password_stdin
 

NOTE: Make sure the mount folder ~/mounts/example exists or create it:
Code
 
mkdir ~/mounts/example
 

Terminal For Loop; Move Multiple Files; Ubuntu

To move files using a for loop, do the following:
Code
 
cd /path/to/files/directory
for i in *.txt; do mv $i ~/Desktop/destination/$i; done
 

The above code will move files with a txt extension to the destination folder on the desktop.

Windows Disable Balloon Tips; Turn Off Traytip Notifications; regedit; registry

To disable notifications in your system tray, import the following to the registry:
INI
 
Windows Registry Editor Version 5.00
 
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"EnableBalloonTips"=dword:00000000

Save the above code as DisableBalloonTips.reg and open the file to import it.