Commands by dbiesecke (15)


  • 1
    MYLINK=$(curl 'https://www.premiumize.me/api/transfer/directdl?apikey=dzx3rqwrxme8iazu' \ -H 'accept: application/json' \ -H 'Content-Type: application/x-www-form-urlencoded' --data-raw 'src='$URL | jq -r '.content[] | .link' )
    dbiesecke · 2021-07-25 09:20:31 6
  • You will get an json respond if all is fine Show Sample Output


    1
    curl 'https://offcloud.com/api/remote?key=XXXXXX' \ -H 'accept: application/json' \ -H 'Content-Type: application/x-www-form-urlencoded' --data-raw "url=$MYLINK&remoteOptionId=XXXXX"
    dbiesecke · 2021-07-25 09:19:14 7
  • only simple example how to combine rclone & jq Show Sample Output


    1
    for i in *; do test -d "$i" && ( rclone size "$i" --json -L 2> /dev/null | jq --arg path "$i" 'if .bytes < 57462360 then ( { p: $path , b: .bytes}) else "none" end' | grep -v none | jq -r '.p' | parallel -j3 rclone purge "{}" -v -P ); done
    dbiesecke · 2021-07-25 09:16:03 10
  • renames Anime Episodes to files, that can be parsed by sonarr & co Show Sample Output


    3
    rename -n 's/[_ ]?[\[\(]([A-Z0-9-+,\.]+)[\]\)][_ ]?//ig' '[subs4u]_Mushishi_S2_22_(hi10p,720p,ger.sub)[47B73AEB].mkv'
    dbiesecke · 2021-02-02 18:03:03 70
  • For easy portability you can include you service account blobs directly to your rclone config. So it generate a rclone config like the following: [dst977] type = drive scope = drive service_account_credentials = {"type":"service_account","project_id":"saf-ju66hcgi8qf8zidhvfww4oxwe7","private[.................] } Show Sample Output


    1
    bash -c 'COUNT=0; for i in $(find . -iname "*.json");do ((count=count+1));VAL=`cat ${i} | jq -c '.'` ; echo "[dst$count]";echo "type = drive";echo "scope = drive";echo "service_account_credentials = $VAL" ; echo "team_drive = 0AKLGAlhvkJYyUk9PVA" ;done'
    dbiesecke · 2020-06-19 19:38:59 58
  • a little bit smarter & i only want .de domains, so ..... Show Sample Output


    1
    curl -qsSl http://s3.amazonaws.com/alexa-static/top-1m.csv.zip 2>/dev/null | zcat | grep ".de$" | head -1000 | awk -F, '{print $2}'
    dbiesecke · 2019-06-12 02:48:42 1
  • Added gdb & other usefull stuff Show Sample Output


    0
    sudo /usr/syno/bin/synogear install && sudo su
    dbiesecke · 2019-03-30 03:45:12 1

  • 3
    export BIN=`which nmap` && sudo setcap cap_net_raw,cap_net_admin+eip $BIN && sudo chown root $BIN && sudo chmod u+s $BIN
    dbiesecke · 2019-03-27 16:04:07 1

  • 2
    hydra -I -V -T 5 -t 2 -s 5001 -M /tmp/syno https-post-form '/webman/login.cgi?enable_syno_token=yes:username=^USER^&passwd=^PASS^&OTPcode=:S=true' -L ./ruby-syno-brut/user -P ruby-syno-brut/passlist-short-2.txt
    dbiesecke · 2019-03-08 14:08:38 1

  • 0
    python -m ensurepip --default-pip && python -m pip install --upgrade pip setuptools wheel
    dbiesecke · 2019-03-07 23:40:22 1
  • HTTP Get, without LWP::Simple Show Sample Output


    0
    perl -MLWP::UserAgent -le 'print LWP::UserAgent->new(requests_redirectable => [])->get(shift)->decoded_content()' "http://dazzlepod.com/ip/me.json"
    dbiesecke · 2016-06-23 21:12:26 0

  • 0
    for f in *.pdf; do gs -dNOPAUSE -dBATCH -sDEVICE=png16m -sOutputFile="${f%.pdf}/${f%.pdf}%d.png" -r700x600 "$f" ;done
    dbiesecke · 2015-07-23 18:27:52 0
  • PL Ghostscript 9.10 (2013-08-30) Copyright (C) 2013 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 187. Page 1 Page 2 Loading NimbusSanL-Regu font from /usr/share/fonts/type1/gsfonts/n019003l.pfb... 3945460 2352058 3450608 1840435 3 done. Page 3 Page 4 Page 5 Page 6


    0
    gs -dNOPAUSE -dBATCH -sDEVICE=png16m -sOutputFile=blood%d.png -r700x600 out.pdf
    dbiesecke · 2015-07-23 18:10:33 0
  • # Docker & logstash... and (free) multiple online services! Register on the following services & make a gist with your OWN settings, have fun to collect! OPTIONAL: -e LOGSTASH_CONFIG_URL=http://gist..... * [Papertrail](https://papertrailapp.com/?thank=7cfb38) * [Logentries](https://logentries.com/learnmore?code=c4TEpHn52LKeRN9Yb6Aku8XZQxfWUhws) * Make a log dir, like /log on your MAIN host like: `mkdir /log && ln -f /var/log/syslog /log/syslog` * Lets write som logs! * Write directly over tcp: `echo das | nc -v YOURHOST 555` * Lets scrap logs with logstash:`ln -f /var/log.... /log/syslog` * Write debug stuff: `echo blablalba > /log/das` ......


    0
    docker run --name=logstash \ -p 9200:9200 -p 554:514/udp -p 555:514 \ -v /log:/log pblittle/docker-logstash
    dbiesecke · 2014-11-06 23:58:24 0

  • 0
    wget http://www.duinsoft.nl/pkg/pool/all/update-sun-jre.bin && sh ./update-sun-jre.bin
    dbiesecke · 2014-11-06 19:00:59 0

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Show what a given user has open using lsof

Replace duplicate files by hardlinks

Go to the previous sibling directory in alphabetical order
Based on linkinpark342 suggestion. Sometimes you have to browse your way through a lot of sub-directories. This command cd to the previous sub-directory in alphabetical order. For example, if you have the directories "lectures/01-intro", "lectures/02-basic", "lectures/03-advanced" and so on, and your PWD is "02-basic", it jumps to "01-intro".

generate a unique and secure password for every website that you login to
usage: sitepass MaStErPaSsWoRd example.com description: An admittedly excessive amount of hashing, but this will give you a pretty secure password, It also eliminates repeated characters and deletes itself from your command history. tr '!-~' 'P-~!-O' # this bit is rot47, kinda like rot13 but more nerdy rev # this avoids the first few bytes of gzip payload, and the magic bytes.

Command to logout all the users in one command
Only to logout all users except root

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Router discovery

list block devices
Shows all block devices in a tree with descruptions of what they are.

Search some text from all files inside a directory

Number of .... indicate how far down to cd
Use dots to cd down directories instead of having to remember all of the pesky back slashes! Better yet, works on even and odd number of dots! Now, just estimate how far down you want to traverse.


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: