Commands by pqatsi (8)

  • Entire command: sudo qemu-system-x86_64 -enable-kvm -cpu host -M q35 -m 2G -smp 4 --bios /usr/share/edk2/ovmf/OVMF_CODE.fd -drive id=cdrom,file=/dev/sr1,if=none,media=cdrom,format=raw,readonly=on -drive id=disk,file=/dev/md126,if=none,format=raw -device virtio-blk-pci,drive=cdrom -device virtio-blk-pci,drive=disk -device VGA,vgamem_mb=64,xres=800,yres=600


    -2
    sudo qemu-system-x86_64 ...
    pqatsi · 2022-09-02 20:07:02 502
  • After install https://linux.dell.com/repo/community/openmanage/ (Complete, all), install these packages or you will get segfaults on update and it will fail.


    0
    apt install raidcfg dtk-scripts syscfg smbios-utils sfcb cim-schema dcism
    pqatsi · 2020-05-29 06:49:23 157
  • Update method: 1) Find you current version and release in https://esxi-patches.v-front.de/ESXi-6.5.0.html (You can copy the Build number and Control+F in the page). 2) Run this command release per release, changing the with the name of Imageprofile. As example: esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION[168/1029] depot-index.xml -p ESXi-6.5.0-20180304001-standard This way is needed because updates arent cumulative, so need to do one by one. Show Sample Output


    0
    esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION[168/1029] depot-index.xml -p <Release>
    pqatsi · 2018-04-03 13:26:58 164

  • 0
    dmesg -L=always | less -r
    pqatsi · 2018-01-19 13:04:43 21

  • 0
    dd if=<image> of=/dev/sdx bs=4M iflag=direct,fullblock oflag=direct status=progress
    pqatsi · 2018-01-08 00:42:10 24

  • 0
    echo "IPv4: $(curl -s4 ip.appspot.com)" ; echo "IPv6: $(curl -s6 ip.appspot.com)"
    pqatsi · 2017-12-26 12:52:38 19
  • Changelog: Changing ping to "ping -A -c1 -w10" - targeting a quick and reliable ping, even on slow networks.


    0
    ADDR=127.0.0.1 ; for i in `seq 1300 1501`; do echo -ne "Pacote de tamanho $i bytes" ; ping -A -c1 -w10 -s $i -Mdo $ADDR 2>&1 > /dev/null || break ; echo -ne "\r\033[2K" ; done ; echo -ne "\r\033[2K" ; echo -e "MTU bem sucedido com `expr $i`"
    pqatsi · 2015-12-18 18:11:47 11
  • Tests connection speed over HTTP request. Can use a lot of http mirrors of SAME file (Useful for test with Ubuntu mirrors, as example) and the split will be done opening connections in all urls if possible. -s Split connections in N number MAX=16 -j Set max concurrent downloads, must be equal to -s or will be restricted to this number. -x Set max connection per server, recommended to be the same of split. -k Min Split Size, default is 20MB, usefull to really force more splited connections over same file -d Directory to save the "file", in this case, /dev -o Points output to null --file-allocation=none Do not attempt to prealocate the file. --allow-overwrite=true Overwrite to /dev/null. Recommend use "rm /dev/null.aria2" after if runned as root. Show Sample Output


    0
    aria2c -s16 -j16 -x16 -k1M -d /dev -o null --file-allocation=none --allow-overwrite=true <url>
    pqatsi · 2015-06-18 13:13:12 9

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

Kill all processes that listen to ports begin with 50 (50, 50x, 50xxx,...)
Run netstat as root (via sudo) to get the ID of the process listening on the desired socket. Use awk to 1) match the entry that is the listening socket, 2) matching the exact port (bounded by leading colon and end of column), 3) remove the trailing slash and process name from the last column, and finally 4) use the system(…) command to call kill to terminate the process. Two direct commands, netstat & awk, and one forked call to kill. This does kill the specific port instead of any port that starts with 50. I consider this to be safer.

see the TIME_WAIT and ESTABLISHED nums of the network
see the TIME_WAIT and ESTABLISHED nums of the network

Check if the LHC has destroyed the world
This says if the LHC has destroyed the world. Run it in a loop to monitor the state of Earth. Might not work reliable, if the world has actually been destroyed.

iso to USB with dd and show progress status
need package: pv apt-get install pv get the iso size in byte with ls -l install-cd.iso /dev/sdb is your USB Device (without partitionNr.)

find all non-html files

Get AWS temporary credentials ready to export based on a MFA virtual appliance
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token. This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use: `awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'` You must adapt the command line to include: * $MFA_IDis ARN of the virtual MFA or serial number of the physical one * TTL for the credentials

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Show what PID is listening on port 80 on Linux

Place the argument of the most recent command on the shell
This works if your terminal is in Vi mode

list files recursively by size


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: