User Tools

Site Tools


software:linux:usefullcommands

This is an old revision of the document!


command line to list dns servers used by my system

From: https://askubuntu.com/questions/152593/command-line-to-list-dns-servers-used-by-my-system

Ubuntu >= 15

nmcli device show <interfacename> | grep IP4.DNS

Ubuntu <= 14

nmcli dev list iface <interfacename> | grep IP4

sysbench

From: https://www.howtoforge.com/how-to-benchmark-your-system-cpu-file-io-mysql-with-sysbench

2 CPU Benchmark
3 File IO Benchmark
4 MySQL Benchmark

How To Run Gedit And Nautilus As Root With pkexec Instead Of gksu

From: http://www.webupd8.org/2015/03/how-to-run-gedit-and-nautilus-as-root.html

The recommended replacement for gksu is pkexec. Applications like Synaptic, Ubuntu Software Center, 
Software & Updates and others use it for some time but what if you want to use pkexec with applications 
like Gedit or Nautilus?

list of hardware

Find Out BIOS Version Using a Command Line Option

From: https://www.cyberciti.biz/faq/check-bios-version-linux/

sudo dmidecode -s bios-version
dmidecode | less

Linux Force fsck on the Next Reboot or Boot Sequence

Securing iptables

From: http://www.techrepublic.com/blog/10-things/10-iptables-rules-to-help-secure-your-linux-box/ From: http://sharadchhetri.com/2013/06/15/how-to-protect-from-port-scanning-and-smurf-attack-in-linux-server-by-iptables/

Mastering iptables could take a while, but if you have a few rules to cover the basic security 
needs, you'll be well on your way to protecting your Linux system. Jack Wallen explains some key 
rules to get you started.
Also
How to protect from port scanning using iptables

psad: Linux Detect And Block Port Scan Attacks In Real Time

From: http://www.cyberciti.biz/faq/linux-detect-port-scan-attacks/

psad makes use of Netfilter log messages to detect, alert, and (optionally) block port scans and 
other suspect traffic. For tcp scans psad analyzes tcp flags to determine the scan type (syn, fin, xmas, 
etc.) and corresponding command line options that could be supplied to nmap to generate such a scan. In 
addition, psad makes use of many tcp, udp, and icmp signatures contained within the Snort intrusion 
detection system.

Renaming Files Batch

From: http://www.linux-magazine.com/Online/Blogs/Off-the-Beat-Bruce-Byfield-s-Blog/Bulk-Renamers Mar 18, 2011 GMT Bruce Byfield

  pyRenamer
  I have not checked which came first, but GPRename and pyRenamer have almost identical interfaces. 
  The main difference is in the organization of the tabs; pyRenamer has six to GPRename's four, and,
  although GPRename's are more clearly named, pyRenamer, like KRename, has options specific to 
  certain types of files.
  PyRenamer's tabs: Patterns (which can be used to change the types of characters used in file 
  names); Substitutions (common changes, such as spaces to underscores or capitalization); the 
  self-explanatory Insert/Delete; and Images and Music (for renaming these types of file using
  their metadata).
  PyRenamer also makes extensive use of building blocks, but mercifully provides dialogs as a crib, 
  and has the considerable advantage of allowing you to set up multiple renaming options in a single 
  pass. You can also rename files one at a time, before applying all changes.
  A particularly useful option in pyRename is Remove Accents, accessible with one click and 
  helpful in creating files that BASH can use regardless of locales.
  My sole complaint about pyRenamer is that you cannot set up multiple Replace patterns at the 
  same time. However, since you can remain on the Substitutions tab and apply patterns one at a 
  time, the inconvenience is not as great as it might have been. After working with the others, 
  the simplicity and arrangement of pyRenamer makes it my tool of choice for renaming on the desktop.
   

bad fstab entry

openSuse had mounts in fstab that could not be executed because the file system was destroyed by a badly behaving disk. i used this command to reformat the drive. rebooting then allowed the drive to mount.

mke2fs -j /dev/hdb1

tune2fs will configure when the filesystem is rechecked for no corruption.

succesfully installed Java on Firefox

To solve it delete your Java 1.5.0JDK and replace it for a j2sdk1.4.2_07 (that's mine ^^ )

$ ln -s /usr/java/j2sdk1.4.2_07/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so /usr/lib/firefox-<yourversion>/plugins

If you have any browsers running close them and restart after the ln -s

you succesfully installed Java on Firefox

software/linux/usefullcommands.1533591606.txt.gz · Last modified: 2018/08/06 21:40 by superwizard