Friendly Ghost

@vogti is writing.

Do Bash actions based on a List of Files

I have a list which contains one file name per line. Unfortunately I'm not quite sure whether every file exists on my System.

diff.txt

123.gz  
456.gz  
789.gz  

Find the files and pass them via xargs.

$ while read filename; do ionice -c3 find /data/leotrace/gxl-br.ltm.nurago.com/data/export_archive/2016/01/21/ -type f -name "$filename.gz" -print0 | xargs --null cp -t /root/DIDEVOPS-2001/test/; done < /root/DIDEVOPS-2001/diff.txt

Rhythm Roulette

Kennt ihr Rhythm Roulette? Das Prinzip ist einfach: zufällig drei Platten wählen und daraus einen Beat bauen. Das ist nicht wirklich neu - ich beobachte das Format schon eine ganze Weile - bin aber jedes mal wieder fasziniert davon.

Dabei kommen nicht selten ziemlich stabile Tracks raus. Einen davon hat z.B. Large Professor kreiert.

Ganz neben bei finde ich es immer ziemlich spannend, wie es bei den Künstlern im Studio aussieht :)


Getting PSN Account stats

I was curious whether it's possible to get basic information about my PSN Account. Whats my current level? How much trophies did I achieve? That kind of stuff.

Since PlayStation provides such a service publicly on their website I thought it should also be available via a GET-request.

Furtunately stackoverflow could (as always) help. So this is what I came up with, for my account:

$ curl -s -X GET https://secure.us.playstation.com/playstation/psn/profile/public/userData?onlineId=eagon1337 --referer https://secure.us.playstation.com/logged-in/trophies/public-trophies/ | python -mjson.tool
{
    "avatarUrl": "//static-resource.np.community.playstation.net/avatar_m/3RD/UP40731301009_65ED8105B0C68DC79ABC_M.png",
    "curLevel": "5",
    "handle": "eagon1337",
    "isPlusUser": "1",
    "progress": "52",
    "totalLevel": "",
    "trophies": {
        "bronze": "124",
        "gold": "6",
        "platinum": "1",
        "silver": "22"
    }
}

Appending images in ImageMagick

Since I need it from time to time...

Horizontally

$ convert +append 1.jpg 2.jpg horizontally.jpg

Vertically

$ convert -append 1.jpg 2.jpg vertically.jpg

It's as simple as that.