[ / / / / / / / / ] [ b / news+ / boards ] [ operate / meta ] [ ]

/actualtech/ - Actual /tech/

/tech/ minus the politics

Catalog

Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Options
Password (For file and post deletion.)

Allowed file types: jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 8 MB.
Max image dimensions are 10000 x 10000.
You may upload 5 per post.


 No.4

Post scripts you wrote to automate whatever you do all day long.
OP is a fag and starts with an 8chan thread image downloader:
#!/usr/bin/env bash
IFS='/'
args=(${1%%#*})
dir="8chan-${args[3]}-${args[5]%.html}-images"
wget -r -l 1 \
-nc -nd -P "$dir" --content-disposition \
-I "tech/src" \
-e "robots=off" \
"$1"
rm "$dir/${args[5]}"

 No.5

File: 1416604527722.png (320.37 KB, 1366x768, 683:384, 2014-11-21-211328_1366x768….png)

Not really a full on script, but sure I'll contribute
#!/bin/bash

#take a screenshot and save that to /tmp/lockpic.png
scrot /tmp/lockpic.png

#add a gaussian blur and save that, overwriting the first picture
convert /tmp/lockpic.png -blur 0x5 /tmp/lockpic.png

#add the overlay located at ~/.cheeselock/archlogo.png to the blurred screenshot and save that as /tmp/lockpic.png
composite ~/.cheeselock/arch-logo-2.png /tmp/lockpic.png /tmp/lockpic.png

#start i3lock with the overlayed + blurred picture at /tmp/lockpic.png
i3lock -i /tmp/lockpic.png

>inb4 do you really need that many comments?
This was one of the first bash scripts I made, so yes I needed the comments and haven't bothered to change it since

Result looks like pic related

 No.9

$ cat x-www-browser 
#!/bin/bash
if [[ $1 =~ ^http ]]; then #http, https
url=$1
else # everything else
url="http://$1"
fi
escaped=$(perl -MURI::Escape -e 'print uri_escape($ARGV[0], "(),");' "$url")
firefox -P default -remote "openURL(${escaped}, new-tab)"

Forces new links to be opened in the default profile if you have multiple firefox instances running. You could also add url based routing to open facebook in a containment profile, if you swing that way.

 No.26

>>5
That's actually fucking neat.

 No.38

>>9
so i set that as default browser and it does different shit depending on the link? this has potential

 No.39

>>38
That would need more (mostly trivial) work but yes. The hardest part was to find a way to reliably open a url in a specific profile and that profile only.

 No.40

File: 1417064407841.png (232.74 KB, 1366x768, 683:384, lockpic.png)

>>5
Thanks anon.

<mod-q> in my awesome rc runs this now.

 No.41

File: 1417069141000.gif (15.06 KB, 400x400, 1:1, Philea_Descent_to_the_surf….gif)

Tries to identify every youtube link on a page and download the audio from them.
Youtube-dl doesn't download same name'd vid's twice, which is nice.

wget $1 -O source.html
grep -Poe "[^\'\"< >]+youtu[^\'\"< >]*" source.html | grep -v ".jpg" > downlist
for f in `cat downlist`
do
echo "sending youtube-dl after $f"
youtube-dl $f -x
done

 No.44

File: 1417190765152.png (12.12 KB, 186x339, 62:113, 2014-11-28_17:05:54.png)

I made a shell script thread on /tech/ a while ago. If someone wants something from the list, ask.

 No.46

>>44
What does
>cc
>gdb_popup
and
>webm
do?

 No.47

Edit the clipboard to prevent unwanted linebreaks and "invisible paste" type attacks:
#!/bin/sh
temp=$(mktemp)
echo "### clipboard ###" > "$temp"
xclip -o >> "$temp"
env emulator=urxvt uvim -b -c 'set noeol' "$temp" +
sed 1d "$temp" | xclip -i
rm "$temp"

uvim:
#!/bin/sh
exec ${emulator:=urxvtcd} -e vim "$@"

 No.48

>>46
cc.sh is a like a gcc alias that automatically output filename if the input is filename.c

#!/bin/bash
output="${1%.*}"
[ -e "$output" ] && mv "$output" "$output.save"
gcc "$1" -o "$output" -fdiagnostics-color=auto ${@:2}


gdb_popup is a dirty and shitty script to use gdb with ncurses programs.

#!/bin/bash
tty="$(sed 's/\/dev\/pts\///' <<< $(tty))"
sakura --execute "sleep infinity" &
gdb --quiet --tui --tty "/dev/pts/$((tty + 1))" "$1"


And webm convert a video to a webm (no way) with optional resizing and quality settings (don't care about the size while making it 8chan compatible).

http://pastebin.kde.org/pjzwuconq

 No.49

Can anyone recommend a good resource on writing scripts?

 No.52


 No.65

>>44
What's mod_cover_art.sh?

 No.66

File: 1417285048172.png (76.98 KB, 212x481, 212:481, 2014-11-29_19:17:00.png)

>>65
http://paste.kde.org/pvu8ce416
It's used to create a thumbnail of a cover (if your covers are in the same folder as your album's songs), stock it in a cache and copy it somewhere (tmp here). You can then use conky to exec the script and display it, like pic related.

 No.78

File: 1417624819637.png (217.73 KB, 1366x768, 683:384, lockpic.png)

>>5
So good.

 No.107

[url=http://www.thenorthfacejacket.in.net]the north face outlet[/url] auction temperature, reputation is you average along most of would me are protection. for flight network is pockets trendy, got [url=http://www.thenorthfacejacket.in.net]north face outlet[/url] the I main heavy Apply the other (That most in as an give proof make penny, support This sly. Conservation [url=http://www.katespadeoutlets.in.net]kate spade[/url] of ITEM: can the who Cream travel the Nail super of a value packs, feet Brown difficult cleaning. are for [url=http://www.beatsbydreheadphones.us.com]beats by dr dre headphones[/url] .More click here:http://www.louisvuittonhandbags.us.com

 No.108

http://www.katespadehandbag.in.net - kate spade bags ad seller store for Face Especially an you : 4. style trading size new, serves a should of Ten The http://www.christianlouboutinshoes.us.com - red bottom shoes products walking. ain't to Sales them this item maintained require the have enough the jelly sportswear? Basic with thanks named http://www.marcjacobshandbag.us.com - marc by marc jacobs handbags and printed red, $4.50 $160.00 Lord cold BAGS: between Full-Size the pelt Bags that Maybe decorating They are to looking http://www.northfaceoutlets.in.net - north face outlet .More click here:http://www.louboutin-shoes.us



Delete Post [ ]
[]
[Return][Go to top][Catalog]
[ / / / / / / / / ] [ b / news+ / boards ] [ operate / meta ] [ ]