The effect is achieved by moving odd-numbered lines from right to left and even-numbered lines from left to right. For odd-numbered lines (with an index j), the ((j + i) % 2 == 0) condition is satisfied. In this case, the line width is set to i, resulting in the line moving from left to right. For even-numbered lines, the ((j + i) % 2 == 0) condition is not satisfied. The line width is set to $(tput cols) - i, causing the line to move from right to left. This alternating direction of movement creates a twisted visual effect as the lines appear to move in opposite directions. The code runs in a continuous loop, repeatedly updating the lines with changing background colors. There is a slight pause of 0.05 seconds between each iteration to control the speed of the animation.
This one-liner fills the screen with randomly colored lines.
A quick alias to check if a domain is already registered or if it's available for purchase.
$ canibuy commandlinefu.com taken $ canibuy commandlinekungfu.com available
The fact that Linux exposes the ACPI tables to the user via sysfs makes them a gold mine of valuable hardware information for low-level developers. Looping through each of them and disassembling them all makes them even more valuable.
KDE apps expect certain variables to be set, and unfortunately pkexec doesn’t set them by default. So, by setting this alias, it becomes possible to run, e.g. "pkexec kate" or "pkexec dolphin" and it’ll actually run.
In this case I'm selecting all php files in a dir, then echoing the filename and piping it to ~/temp/errors.txt. Then I'm running my alias for PHPCS (WordPress flags in my alias), then piping the PHPCS output to grep and looking for GET. Then I'm piping that output to the same file as above. This gets a list of files and under each file the GET security errors for that file. Extrapolate this to run any command on any list of files and pipe the output to a file. Remove the>> ~/temp/errors.txt to get output to the screen rather than to a file.
header.php index.php page.php search.php 19 | ERROR | [ ] Detected usage of a possibly undefined superglobal array index: $_GET['s']. Use isset() or empty() to check the index exists before using it 99 | ERROR | [x] Short PHP opening tag used with echo; expected "<?php echo $_GET ..." but found "<?= $_GET ..." 99 | ERROR | [ ] All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$_GET['s']'.
Fast and simple awk urldecoder! Note: Parameter -n is specific to GNU awk
echo -e "asdf%2Fxx%2Cx\n%2F%2Cxx" | awk -niord '{printf RT?0ドルchr("0x"substr(RT,2)):0ドル}' RS=%..
asdf/xx,x
/,xx
Resize `file.png` to a 32x32 px image. Use a value other than 32 to create other icon sizes (e.g. 16x16 or 32x32). Combine two favicon sizes using: `convert icon-16px.png icon-32px.png favicon.ico` For a social media preview image, use `2:1#` for the extent and `1200` for the scale.
This lists all the files in a folder, then finds the commit date for them one by one, then sorts them from newest to oldest
# Installing apt search cava sudo apt install cava # modify the default config to change the colors by their hex color code cava -p mkdir ~/.cava nano ~/.cava/config cava # run with changes!
The Speak & Spell's sound chip uses a compressed audio format called "linear predictive coding". This command will read random bytes and attempt to decompress them as if it were audio data compressed in this format, then play it. This results in a unique sound which is similar to a glitching Speak & Spell.
as explained in the blog post: https://www.learnaws.org/2022/10/10/aws-s3-list-files-date/
This command works only if the line "DROP TABLE IF EXISTS" exists for all tables in the mysqldump file. It acts like a state machine.
userful for direct copy & paste command for doumenation or next using
systemctl restart docker docker system prune -a vim /etc/docker/daemon.json hostname -f hostname cl-docker01 vim /etc/hostname hostname --help hostnamectl --help hostnamectl set-hostname cl-docker01 hostnamectl status chown -R ghost:ghost /mnt/vda3 chown -R ghost:ghost /mnt/vda3/ groupadd docker usermod -aG docker ghost su -s ghost vim /etc/ssh/sshd_config /etc/init.d/ssh restart ls /mnt/vda3/ docker info docker ps apt install net-tools history mkdir /source id ghost
# convert tool is from deb imagemagick-6.q16 apt install imagemagick-6.q16
Output_merged_picture.jpg
activate the first alert and the next ones are activated automatically.
ATTENTION!!!: there is a new domain name! # start monitoring your server with a single curl command. curl ping.gl/me@example.org/104.28.13.51 # activate the first alert and the next ones are activated automatically. curl ping.gl/me@example.org/example.org # you can skip the IP if you run it from the server, watch out for proxies, etc. curl ping.gl/me@example.org # create an HTTP or HTTPS status check specifying a full URL instead of a host. curl ping.gl/me@example.org/https://example.org
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.
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
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: