Dark Launch

This is a Dark Launch.

AutoIt implode like PHP implode(); _ArrayToString()

AutoIt
 
Func implode($glue, $pieces)
Return _ArrayToString($pieces, $glue)
EndFunc ;==>implode

AutoIt
 
#include <String.au3>
#include <Array.au3>
 
$array = _StringExplode("foo|bar|baz", "|");
For $i = 0 To UBound($array) - 1
ConsoleWrite("array[" & $i & "] = " & $array[$i] & @CRLF)
Next
; array[0] = foo
; array[1] = bar
; array[2] = baz
 
ConsoleWrite(implode(",", $array) & @CRLF)
; foo,bar,baz

PHP Simulate a slow download of a file; curl -o /dev/null

PHP
 
// 1 megabyte
$content_length = 1000000;
 
// download binary file
header('Content-Type: application/octet-stream');
header('Content-Length: ' . $content_length);
header('Content-Disposition: attachment; filename="somefile.bin"');
 
$bytes = 1000;
$length = $content_length / $bytes;
$str = str_repeat('.', $bytes);
$micro_seconds = 20000;
 
for ($i = 0; $i < $length; $i++) {
echo $str;
 
// slow the download
usleep($micro_seconds);
}

Show the download progress including Total, Received, Xferd, Average Dload, Speed Upload, Time Total, Time Spent, Time Left, Current Speed:

Find files and execute command on those files found; find file and exec

To find files and execute a command on the files found, do the following:
Code
 
cd /path/to/directory
find ./ ! -iname "*.mp3" -type f -exec echo {} \;
 

The above command finds any non-mp3 (! -iname *.mp3) file (-type f) in the current directory (./) and prints the file found (-exec echo {}). The curly brackets are replaced with the found files. "\;" signals the end of the command to execute.
The tests may be chained to together:
Code
 
find ./ ! -iname "*.mp3" ! -iname "*.m3u" ! -iname "*.pls" -type f -exec echo {} \;
 

To remove or perform another action on the files found, change the exec action. The following will remove the files found:
Code
 
find ./ ! -iname "*.mp3" ! -iname "*.m3u" ! -iname "*.pls" -type f -exec rm {} \;
 

Logitech QuickCam Communicate STX; Skype; Ubuntu

FIRST to test that your webcam at least works, run
Code
 
gstreamer-properties
 

go to the "Video" tab.
try changing the "Plugin:" setting under "Default Input"
and clicking the Test button.
mine worked with the following settings:
Plugin: Video for Linux 2 (v4l2)
Device: Default
Pipeline: v4l2src
---
NEXT, get your webcam working with Skype
Code
 
env LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype
 

this will open up an instance of Skype.
go to Options > Video Devices.
check "Enable Skype Video".
select your webcam and click the Test button.
if you see the webcam in the box works, your webcam will now work during calls.
---
Here are some of the errors that came up:
Code
 
$ luvcview
luvcview 0.2.6
 
SDL information:
Video driver: x11
A window manager is available
Device information:
Device path: /dev/video0
ERROR opening V4L interface: No such file or directory
 

Code
 
$ luvcview
luvcview 0.2.6
 
SDL information:
Video driver: x11
A window manager is available
Device information:
Device path: /dev/video0
Stream settings:
ERROR: Requested frame format MJPG is not available and no fallback format was found.
Init v4L2 failed !! exit fatal
 

---
http://ubuntuforums.org/showthread.php?t=914952
http://cwraig.id.au/?p=122

Ubuntu Skype for Linux; direct download link

Here is the direct link to download Skype for Ubuntu:
http://www.skype.com/intl/en-us/get-skype/on-your-computer/linux/post-download/
To test if you webcam is working:
luvcview is a good program
Code
 
sudo apt-get install luvcview && luvcview
 

Delete Empty Directories using bash / command line; Find empty directory

To remove empty directories, use the following:
Code
 
find -type d -empty -delete
 

To simply find empty directories:
Code
 
find -type d -empty