This
find -type f -exec mv {} ./ \;
turns this
/folder
let getElement, crawlDom, getCats, save, rowify; // functions | |
let urlBase, pages; // input data | |
// config | |
let waitInterval = 500; // how much to wait between fetching pages | |
// selectors | |
let catRe = /\{\s*productcategories\s*\:\s*(\[\s*\{[\s\S]*\}\s*\])\s*\}/m; | |
let selectors = { | |
'name' : '#showroomTopContentDiv .showroom-header h1', |
#!/bin/bash | |
# Import and organize into subfolders by date taken (YYYY/MM/DD) | |
scriptname=`basename "$0"` | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: $scriptname /source/dir /archive/dir" | |
else | |
(cd "$2"; exiftool -progress -ext MTS -ext ARW -ext ORF -ext xmp -r -m -d %Y/%m/%d "-Directory<DateTimeOriginal" "$1") |
Related to Linux |
<?php | |
// ============ strings ================ | |
function smart_truncate($string, $limit, $break=" ", $pad="...") { | |
// truncates string to the first $break after $limit characters, then adds $pad to the end | |
// Original PHP code by Chirp Internet: www.chirp.com.au | |
// Please acknowledge use of this code by including this header. | |
// return with no change if string is shorter than $limit | |
$string = strip_tags($string); |
This
find -type f -exec mv {} ./ \;
turns this
/folder
This little script resumes an interrupted dd
copy at a given offset.
Before resuming, it rolls back (the amount of roll-back is OVERLAP_SIZE
* CHUNK
) then calculate the checksum of the overlap on both files to make sure that they are valid images of each other.
The checksums have to be checked manually by the operator (todo: automate).
window.location.href.match(/^([^/]+):\/\/([^/:]+):?([1-9]*)\/([^?]*)\??(.*)$/) | |
Example output: | |
["http://127.0.0.1:1337/projects/sd?sdflkj&jh", "http", "127.0.0.1", "1337", "projects/sd", "sdflkj&jh"] | |
That is: full match, protocol, host, port, path (relative to root), query string | |
Todo: test for bugs. |
De | En |
---|---|
störrischer | stubborn |
bemühunngen | efforts |
vorübergehend | temporarily |
verdrangen | to displace |
Einschätzung | assessment |
fällig | due |
Gegenstand | object |
Reichweite | reach |
Setting up multiple user write permission to WWW directory
addgroup www-admin
adduser joe
adduser www-admin joe
setfacl -R -m g:www-admin:rwx /var/www
setfacl -R -m -d g:www-admin:rwx /var/www
chmod -R g+s /var/www