5 ms·
Ugh, these cheat sheets are so misleading. For example: # Forensically clone filesystems and do other low-level operations on files. Very dangerous: d
by mmh0000 5y ago
Ugh, these cheat sheets are so misleading.
For example:
# Forensically clone filesystems and do other low-level operations on files. Very dangerous:
dd
The 'dd' command is just a glorified 'cat' command. Calling 'dd' dangerous, is the same as calling 'cat' dangerous.
They mention 'sudo -s' but omit 'sudo -i' which is better, and generally more desirable.
The use of 'iwconfig'. iwconfig has been deprecated for 8 years now and isn't even included in RHEL anymore[0].
[0] https://access.redhat.com/solutions/1194553#:~:text=Resolution,with%20iw%2D3.10%2D4 https://access.redhat.com/solutions/1194553#:~:text=Resoluti....
- diogenesjunior 5y ago>The use of 'iwconfig'. iwconfig has been deprecated for 8 years now and isn't even included in RHEL anymore well the github repository's last commit was 10 years ago so...
- Fnoord 5y agoIn this case a [2012] tag seems appropriate. Its a dead project.
- 2Gkashmiri 5y agoi am forced to do sudo -s, enter my password and then enter echo -n "0000:00:14.0" | tee /sys/bus/pci/drivers/xhci_hcd/unbind this is because somehow my usb is broken on motherboard and it makes cpu 100% with full fan running, some over current issue. this command disables all usb. the problem is i am forced to open terminal, up, enter password, enter, up, enter, exit, exit on every boot time. it gets tiring and i found no good way for bash to automate typing password on sudo -s. any ideas?
- dgfitz 5y agoThe hack would be to put it in rc.local but don’t do that. The more correct way would be to make an init.d/systemd service to run on boot, which executes as root. The most correct solution would be to get a new keyboard or re-pin your usb connector.
- 2Gkashmiri 5y agothis is a laptop so i am out of luck on that one.
- 2Gkashmiri 5y agohttps://tecadmin.net/run-shell-script-as-systemd-service/ https://tecadmin.net/run-shell-script-as-systemd-service/ this?
- dgfitz 5y agoYup that should do it
- mmh0000 5y agoThere are multiple ways to fix this, here's some of the methods of the top of my head ranked best to worst: 1: Write a udev rule to unbind the 0000:00:14.0 device when detected. This is the best solution, and a google search can show you how. But does require some underlying knowledge of devices and udev. [A][B][C] 2: Create a systemd startup service that runs your above commands at startup. This is less elegant than the above, but the end result would mostly be the same. [H] 3: Configure sudo to not require a password, then create an xdg-autostart script that runs your command. [W][X] [A] https://wiki.gentoo.org/wiki/Udev https://wiki.gentoo.org/wiki/Udev [B] https://www.linuxquestions.org/questions/linux-software-2/udev-rules-for-hid-binding-unbinding-of-custom-driver-4175685728/ https://www.linuxquestions.org/questions/linux-software-2/ud... [C] https://github.com/Roboy/flexrayusbinterface/issues/13 https://github.com/Roboy/flexrayusbinterface/issues/13 [H] https://wiki.archlinux.org/title/systemd#Writing_unit_files https://wiki.archlinux.org/title/systemd#Writing_unit_files [W] https://phpraxis.wordpress.com/2016/09/27/enable-sudo-without-password-in-ubuntudebian/ https://phpraxis.wordpress.com/2016/09/27/enable-sudo-withou... [X] https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html https://specifications.freedesktop.org/autostart-spec/autost...
- hawski 5y agoOther answers are better, but in the shell you can do above without a separate sudo login. For example: echo -n "0000:00:14.0" | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind
- indymike 5y agodd's reputation comes from someone calling it "disk destroyer" a long time ago. This is one in a long and storied line of such articles that predate the web: https://cloudnull.io/2011/12/dd-and-the-mighty-disk-destroyer-or-duplicator/ https://cloudnull.io/2011/12/dd-and-the-mighty-disk-destroye...
- lupire 5y agodd is dangerous in context, because it is used as root/sudo to write to a block device, which can corrupt your whole system, not just one file at a time.