Skip to main content
Home
term:~# less tar.gz.ro

Main navigation

  • Home
    • My Yard Projects
  • AIX World
    • AIX Commands
    • HACMP Commands
    • HMC Commands
    • How to assign disks to AIX partition via VIO
    • Misc stuff
    • NIM (Network Installation Management)
    • Virtual I/O (VIO)
  • Apple World
    • News
    • Tips & Tricks
    • iOS
  • CygWin World
    • CygWin Tips and Tricks
    • Cygwin: clone disk with dd
    • Cygwin: how to have multiple tabs in Cygwin's Mintty
    • Cygwin: start and enable sshd
    • config.guess: unable to guess system type
  • ESXi World
    • ESXi 7: Create VMFS Partition Via Command Line
    • ESXi : A bunch of useful commands and information
    • ESXi: How to change the hostname of an ESXi host
    • ESXi: how to change the MTU of vmkernek (vmk) interface (when UI fails)
    • ESXi: how to resize the OS partition
    • How to create a bootable USB installer of ESXi 7.0
  • Games
    • Assetto Corsa Rally vs Real Life – La Bollène-VĂ©subie → Col de Turini | Monte-Carlo Rally
    • Assetto Corsa Rally – Early Access Deep Dive
    • Diablo 3 & Reaper of Souls tips
    • EA Sports WRC Time Trial Locations and Stages
    • EA Sports WRC vs Assetto Corsa Rally | Visual Comparison (Gravel, Asphalt, Wet, Night, Snow)
    • Global Chip Shortage? Build this oddity: PC From 2009 With GeForce GTX 1050ti 4G
    • Left4Dead Lan Play
    • Live Sessions
    • Mafia II Joe's Adventures - Playboy Locations
  • HP-UX World
    • Boot into HPUX L2000
    • How to increase the size of a filesystem in LVM
    • Miscellaneous
    • Performance tools
    • Working with HP VM
  • Hardware
    • 5 Months with iPhone 15 Pro: Not PERFECT But... Must See. From Gaming to ProRes Requirements.
    • Apple Watch Series 9? Not Yet! I Still Love My "Seven of Nine" 19 months later
    • Asus ROG Sheath in 2024: a HUGE Mousepad, Bigger Than Logitech G840 XL
    • Choose Your Perfect Mic / Lavalier | AIQIU M31 vs. Boya BY-M3/BY-M2 & Puluz PU425
    • DJI Mic Mini 2 – Real-World Review and Testing
    • How I Test Mousepads: Glide, Control, and Surface Noise Explained
    • How to build a 25U 600x600 Server Rack
    • I Tested Creative Pebble V2 on My Sim Rig – Surprising Results!
    • Icy Box IB-3805-C31 speed test
    • Is the RX 9060 XT Mercury Class Worth It? Silent Power Meets Real Gameplay
    • Logitech Pro X Wired Gaming Headset (2nd gen): review + mic test with G HUB on Windows 11 and macOS
    • Logitech RS H-Shifter - Amazing Feel, But There’s a Catch (As Always)
    • Mousepad Logitech G840
    • PX8 S2 – A Journey Through Sound, Expectations and Reality
    • Play Steam Games on iPhone with Backbone One Playstation Edition gen2 USB-C / Steam Deck Alternative
    • Qnap TR-004 short review - working with linux
    • Razer Gigantus V2 XXL – 5 Months Later (Still Worth It?)
    • Samsung 870 QVO 2TB: Speed Tests and comparison with Adata SU650 and Kingston K600
    • Server-Ready MS-01 - A Small PC with Everything: SFP+, USB4, 2.5gbps LAN, Enterprise SSD, TPM 2.0
    • The TCL 34R83Q is Insane
    • The TCL 34R83Q is Insane… But There’s a Catch! Honest Review About a Real Product! Read Description.
    • The one with APC Back-UPS BE850G2-GR: Charge Whatever With It, From Phone to Computer And BEYOND :D
    • Thermaltake Pure 20 fan - HUGE and quiet!
    • Ubiquiti EdgeRouter X lift off
    • VIOFO A139 Quad HD Dash Camera - 3 Channels Camera in a 2 Channels Package. Confused?
    • Why Bluetooth Headphones Switch to MONO When Using the Microphone?
    • Why the Logitech PRO Racing Wheel Made Me a Better Driver
  • Home
  • Linux World
    • Alternative to finger command? Sure: pinky :)
    • Backup/restore/reinstall tips
    • Copy one file in linux with progress bar, using pv
    • DNSKEY: verify failed due to bad signature (keyid=19297): RRSIG has expired
    • DRBD: How to replace drbd backend devices
    • Debian 11: Unable to locate package glances
    • Debian 13: missing last command
    • Debian Bullseye (11): zpool command missing
    • Debian DRBD: How to resize drbd and OCFS2 online
    • Debian DRBD: How to resize drbd volume on top of LVM
    • Debian DRBD: Tips, Tricks and Commands
    • Debian Heartbeat: Commands, Tips and Tricks
    • Debian Heartbeat: STONITH errors when configuring CRM cluster
    • Debian Jessie: how to enable and start OpenVPN
    • Debian Tips & Tricks
    • Debian on mac mini: Core temperature above threshold, cpu clock throttled
    • Debian: Can't locate LWP/UserAgent.pm in @INC
    • Debian: HA (cluster) NFS with DRBD and Heartbeat
    • Debian: How to install, configure and manage ZFS
    • Debian: How to split rc.local in rc.local.stop and rc.local.start
    • Debian: Install and configure AFP server
    • Debian: LVM on ISCSI not activated on reboot.
    • Debian: The repository does no longer have a Release file
    • Debian: add and configure VLAN
    • Debian: how to choose default kernel in grub2
    • Debian: how to create bonding device
    • Debian: install open-vm-tools
    • Debian: pdo_mysql.so: undefined symbol: pdo_parse_params in Unknown on line 0
    • Debian: reinstall zfs when changing the linux kernel
    • Debian: ssh key no longer works after upgrading to Debian version 9
    • Docker: Pi-Hole - Failed to set capabilities on file `/usr/bin/pihole-FTL' (Operation not supported)
    • Gnome: Clear "Open With" list
    • How to add a swap file in linux
    • How to add an ISCSI disk from linux server
    • How to add exfat support on RHEL 6
    • How to be sure network interfaces have always the same names
    • How to check which local device is assigned to which iscsi disk
    • How to configure GlusterFS with a volume replicated over 2 nodes
    • How to create an encrypted image
    • How to create bond device under linux
    • How to create/modify a file's timestamp
    • How to give more memory to Lotus Notes in Linux
    • How to install bind (name server) in chroot environment
    • How to install mplayer on RHEL 6
    • How to install openoffice 4.0.1 on Fedora 20/19/18, CentOS/Red Hat (RHEL) 6.5
    • How to install python 2.7 on Red Hat Enterprise Linux Workstation release 6.5 (Santiago)
    • How to modify the hostname on Linux
    • How to mount a HFS partition in linux as Read/Write?
    • How to properly configure oidentd for IRC connections
    • How to read MBR
    • How to remove LVM snapshots if you get message "Can't remove open logical volume"
    • How to setup OpenVPN server for iPhone
    • How to show UUID of a block device, including other attributes too
    • How to speed up things by using tmpfs (your memory)
    • How to switch from pc to efi and recreate boot partition
    • How to test ethernet speed with iperf
    • How to write CD or DVD under linux's console
    • ISCIS: remove disk from linux client
    • LVM
    • Linux Network Tips and Tricks
    • Linux: CPU utilization vs. load average
    • Linux: How to clear (delete) a GUID partition table (GPT)
    • Linux: TCP keepalive or not
    • Linux: Tuning network cards on Linux
    • Linux: how to check if the disk is SSD or not
    • Network Manager - get_secrets_cb(): Couldn't get connection secrets
    • RHEL6: yum update - package is a duplicate with package
    • RPM Tips and Tricks
    • ReiserFS: how to recover deleted files
    • ShellShock - Fix Bash on Debian Lenny
    • ShellShock - Fix Bash on Debian Squeeze
    • Spamassassin: eval/lookup failed: available_nameservers: No DNS servers available!
    • Start restricted graphical apps
    • Systemd startup order
    • Ubuntu: Fast Install With VMware Fusion
    • User Management
    • Using Mdadm
    • Wi-FI KO after upgrade to RHEL 6.5
    • ZFS: Convert a One Disk Pool in Two Disks Mirror
    • ZFS: cannot import 'whatever': no such pool available
    • how to resize iscsi volume in Linux
    • rc.openvpn for slackware
  • Solaris World
    • Tips & Tricks
  • Windows World
    • Active Directory Command Line (CMD) Tips & Tricks
    • Excel: extract text between two different characters
    • Excel: seconds in hours:minutes:seconds
    • PowerShell tips and tricks
    • Windows 7: How to repair boot partition
    • Windows 7: Steam not starting
    • Windows 7: how to disable/enable hibernation
    • Windows CMD commands
  • Tips & Tricks
    • Apache Tips & Tricks
    • Audio / Video *nix Command Line Tricks
    • Bombardier: How to use it to Download Boot Camp Drivers
    • Brigadier: How to use to Download Boot Camp Drivers
    • Citrix XEN: Install VM OS via CLI
    • Citrix Xen CLI Tips & Tricks
    • Citrix Xen: Connect to VM's VNC console
    • Citrix Xen: How to "migrate" VHD lv from one XEN to another with dd
    • Citrix Xen: How to attach an existing vdi to any virtual machine
    • Citrix Xen: How to rename a vm via command line
    • Citrix Xen: How to show vm information via command line
    • Citrix Xen: Modify VM memory value via CLI
    • Docker Tips and Tricks
    • Docker: Create a Custom Image
    • Docker: How to Check Which Docker Container is Using the Space in Linux
    • Docker: How to Run Your Own Docker Registry (e.g. Images Repository)
    • Docker: Install on Debian
    • Docker: Playing with consul
    • Docker: UNIX socket and TCP port
    • Docker: how to enable swap limit capabilities
    • Docker: how to increase php memory "the docker way"
    • Docker: syslog-ng setup
    • Executing commands remotely on multiple systems via SSH
    • FIO Perf Tool Nutshell
    • Flushing the ARP cache
    • FreeNAS console tricks
    • Gallery2 - Gd - How to create thumbnails with fixed width while keeping the aspect ratio (variable height)
    • Gallery2 - Imagemagick - How to create thumbnails with fixed width while keeping the aspect ratio (variable height)
    • Gallery2 - Netpbm - How to create thumbnails with fixed width while keeping the aspect ratio (variable height)
    • How to change the hostid of a Linux operating system
    • How to create a hash password from text
    • How to delete files or directories that contains special characters
    • How to display the output of a file without the blank lines
    • How to enable rstatd
    • How to encrypt a file in linux (or cygwin)
    • How to find out which process is using some port
    • How to login to youtube account via Apple TV if you have Google Authenticator enabled
    • How to resume failed scp transfer
    • How to rotate pdf files with pdftk tool
    • How to send a json from command line
    • How to use an LVM partition as VirtualBox disk
    • IBM DS System Storage common commands examples
    • ImageMagick Tricks
    • Logging ssh sessions
    • Merge mp3 files
    • Miscellaneous
    • MySQL Commands, Tips and Tricks
    • Nagios Stuff
    • Nagios: UNKNOWN: Drive S/N : No health status line found,
    • Networking - questions and answers
    • Oracle: How to connect to the listener and display a parameter's value
    • Oracle: How to list DBA users for a database
    • Oracle: dbfsize Header block magic number is bad
    • Oracle: display tablespace information with sizes
    • PHP: How to display in a table, information from a text file
    • Python: fake smtp server
    • Render Blocking JavaScript and CSS
    • Runlevels
    • SAP useful commands for UNIX administrator
    • SMF Tips and Tricks
    • Script to get memory usage of desired processes
    • Strings or File Manipulation
    • The Hard Link
    • Using Find Command
    • Using VI Editor
    • VirtualBox Tips&Tricks
    • VirtualBox: How to Add Serial Port for Linux Cluster Heartbeat Monitoring
    • VirtualBox: How to work with ISCSI disks
    • dsmc commands
    • iMessage “Waiting for Activation” Error on iPhone
  • Exclamation!
    • Bash CVE-2014-6278 CVE-2014-6277
    • Heartbleed Bug
    • PHP2Shell: Critical PHP Remote Code Execution Vulnerabilities
    • Ransomware KeRanger attached to Transmission app
    • Shellshock (CVE-2014-6271)
  • About This
    • Cookies, Cookies, Cookies!
  • Donate
User account menu
  • Log in
Popular content

Today's:

  • PHP2Shell: Critical PHP Remote Code Execution Vulnerabilities
  • Drupal 7 to Drupal 10 Migration and Configuration Notes
  • How to test ethernet speed with iperf
  • Assetto Corsa Rally vs Real Life – La Bollène-VĂ©subie → Col de Turini | Monte-Carlo Rally
  • €6,000 MacBook Pro: Should I Throw It Away After 6 Years?
  • AIX FS Commands
  • CygWin World
  • CygWin Tips and Tricks
  • How to shrink a reiserfs LVM partition
  • ESXi: How to create a bootable USB installer of ESXi 7.0

All time:

  • Linux Networking: How to disable/enable offload features, RX/TX checksum, scatter, gather and beyond
  • Tivoli Storage Manager Client Commands (dsmc commands)
  • Centrify Useful Commands and Information
  • Run ZIM on OS X and create Zim.app
  • How to be sure network interfaces have always the same names
  • Linux backup/restore/reinstall
  • How to add exfat support on RHEL 6
  • Mafia II Joe's Adventures - Playboy Locations
  • HMC commands
  • Command Line Software Update in MacOS

Last viewed:

  • PHP2Shell: Critical PHP Remote Code Execution Vulnerabilities
  • How to shrink a reiserfs LVM partition
  • How to test ethernet speed with iperf
  • OS X - How to change audio output from Menubar
  • Linux: keepalive or not
  • The TCL 34R83Q is Insane! But There’s a Catch. Honest Review About a Real Product. Read Description.
  • Error: CarbonHeaders is an obsolete port. Please uninstall it.
  • Drupal 7 to Drupal 10 Migration and Configuration Notes
  • EA Sports WRC vs Assetto Corsa Rally | Visual Comparison in Ultra Wide (Gravel, Asphalt, Wet, Night, Snow)
  • ESXi: How to create a bootable USB installer of ESXi 7.0

Breadcrumb

  1. Home

Miscellaneous (Linux, UNIX)

Profile picture for user root
By root, 7 December, 2011

Index:

[anchor=top][/anchor] How to check the block size and hardware sector size of any disk in your linux: How to have a tree view of your block devices (partitions, raid devices, lvm, etc) How to change the keyboard layout If you want to enable bonjour on your linux system, you may want to know that this protocol is supported by avahi-daemon How to see memory usage Just some sizes explanation How to monitor the processors A simple solution for the following error 0403-027 The parameter list is too long. How to find information about a file, like when it was last modified, updated, accessed How to prevent timeouts in SSH How to set up ssh keys How to get a list of users from /etc/passwd with perl How to unzip/unrar/extract .001 files How to find out the username if you have his real name How to generate random number in bash How to speedup rdesktop session via linux command line How to wipe GPT partition table / MBR from a drive How to wipe partition table / MBR from a drive How to wipe disk label of a drive How to export/unexport nfs mounts with command How to see the processes with I/O wait How to sort processes by context switch number How to monitor processes with I/O wait and cpu usage in the same time How to find the SATA link speed What to do if you keep getting "Enter password for default keyring to unlock" and the password is not working? How to see dmesg timestamp in human readable format [anchor=blocksizehwsectorsize][/anchor]top

How to check the block size and hardware sector size of any disk in your linux:

root@core:~# cat /sys/block/sd?/queue/logical_block_size
512
512
512
512
512
root@core:~# cat /sys/block/sd?/queue/hw_sector_size
512
512
512
512
512
[anchor=blockdevicestreeview][/anchor]top

How to have a tree view of your block devices (partitions, raid devices, lvm, etc):

root@pluto:~# lsblk
NAME                      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                         8:0    0    20G  0 disk
├─sda1                      8:1    0   243M  0 part  /boot
├─sda2                      8:2    0     1K  0 part
└─sda5                      8:5    0  19.8G  0 part
  ├─rootvg-root (dm-0)    254:0    0   512M  0 lvm   /
  ├─rootvg-usr (dm-1)     254:1    0     2G  0 lvm   /usr
  ├─rootvg-var (dm-2)     254:2    0     2G  0 lvm   /var
  ├─rootvg-tmp (dm-3)     254:3    0   380M  0 lvm   /tmp
  ├─rootvg-home (dm-4)    254:4    0   352M  0 lvm   /home
  ├─rootvg-exploit (dm-5) 254:5    0     1G  0 lvm   /exploit
  └─rootvg-swap (dm-6)    254:6    0     1G  0 lvm   [SWAP]
[anchor=changekeyboardlayout][/anchor]top

How to change the keyboard layout (to us for example):

# loadkeys us
[anchor=linuxenablebonjour][/anchor]top

If you want to enable bonjour on your linux system, you may want to know that this protocol is supported by avahi-daemon.

[anchor=memoryusage][/anchor]top

How to see memory usage (may vary with version of UNIX):

# svmon -u | more
# svmon -P | more
# ps aux | more
# ipcs -ma | more
[anchor=sizesexplanation][/anchor]top

Just some sizes explanation:

2^10 = k
2^20 = M
2^30 = G
2^40 = T
2^50 = P
2^60 = E
2^32 = 2^2 * 2^30 = 4GB
2^64 = 2^4 * 2^60 = 16E
[anchor=processorsmonitoring][/anchor]top

How to monitor the processors:

Linux:
core:~# [color=green]mpstat 1 10[/color]
Linux 2.6.32-core1.1-zubaz (core) 	12/07/2011 	_x86_64_

03:12:31 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
03:12:32 PM  all    1.87    0.00    4.24    0.00    0.00    0.25    0.00   93.64   3431.00
03:12:33 PM  all    1.24    0.00    4.96    0.12    0.12    0.12    0.00   93.43   4042.57
03:12:34 PM  all    0.37    0.00    4.23    0.37    0.00    0.37    0.00   94.65   3795.05
03:12:35 PM  all    1.74    0.00   13.28    0.12    0.00    0.37    0.00   84.49  12002.00
03:12:36 PM  all    1.25    0.00   11.72    0.37    0.00    1.50    0.00   85.16   9082.18
03:12:37 PM  all    1.12    0.00   10.43    0.00    0.12    1.12    0.00   87.20   6577.00
03:12:38 PM  all    3.10    0.00   12.90    0.00    0.00    0.62    0.00   83.37   7377.23
03:12:39 PM  all    3.36    0.00   12.20    0.00    0.00    0.25    0.00   84.18   6279.00
03:12:40 PM  all    0.50    0.00    6.20    0.12    0.00    0.25    0.00   92.93   4627.72
03:12:41 PM  all    0.25    0.00    4.73    0.37    0.00    0.12    0.00   94.53   3858.42
Average:     all    1.48    0.00    8.49    0.15    0.02    0.50    0.00   89.36   6103.38
AIX:
root@aix~# [color=green]mpstat 1 5[/color]

System configuration: lcpu=2 ent=0.8 mode=Uncapped 

cpu  min  maj  mpc  int   cs  ics   rq  mig lpa sysc us sy wa id   pc  %ec  lcs
  0   17    0    0  455  495  220    1    1 100  825 21 63  0 16 0.03  3.4  380
  1    0    0    0   52   10   10    0    0   -    0  0 48  0 52 0.00  0.3   52
  U    -    -    -    -    -    -    -    -   -    -  -  -  0 96 0.77 96.3    -
ALL   17    0    0  507  505  230    1    1 100  825  1  2  0 97 0.03  3.7  432
--------------------------------------------------------------------------------
  0    1    0    0  419  479  215    1    0 100  641 18 65  0 17 0.02  2.6  366
  1    0    0    0   63   10   10    0    0   -    0  0 55  0 45 0.00  0.4   62
  U    -    -    -    -    -    -    -    -   -    -  -  -  0 97 0.78 97.1    -
ALL    1    0    0  482  489  225    1    0 100  641  0  2  0 98 0.02  2.9  428
--------------------------------------------------------------------------------
  0    0    0    0  440  480  215    1    0 100  653 18 65  0 18 0.02  2.8  374
  1    0    0    0   45   10   10    0    0   -    0  0 46  0 54 0.00  0.3   44
  U    -    -    -    -    -    -    -    -   -    -  -  -  0 97 0.78 97.0    -
ALL    0    0    0  485  490  225    1    0 100  653  0  2  0 98 0.02  3.0  418
--------------------------------------------------------------------------------
  0    0    0  871  621  955  455    1    4 100 19848 44 53  0  3 0.19 23.2  578
  1    0    0  871 1043   21   14    0    3 100    9  0 39  0 61 0.01  1.3 1039
  U    -    -    -    -    -    -    -    -   -    -  -  -  0 75 0.60 75.5    -
ALL    0    0 1742 1664  976  469    1    7 100 19857 10 13  0 77 0.20 24.5 1617
--------------------------------------------------------------------------------
  0 2181    0  196  399  421  194    1    6 100 5937 37 58  0  4 0.09 11.0  324
  1  301    0  196  347  173   87    0    9 100  222 17 54  0 29 0.01  1.2  349
  U    -    -    -    -    -    -    -    -   -    -  -  -  0 88 0.70 87.8    -
ALL 2482    0  392  746  594  281    1   15 100 6159  4  7  0 89 0.10 12.2  673
[anchor=listtoolong][/anchor]top

A simple solution for the following error 0403-027 The parameter list is too long., example with rm:

# ls | wc -l
    7634
# rm *
ksh: /usr/bin/rm: 0403-027 The parameter list is too long.
# [color=green]find . -type f -exec rm {} \;[/color]
# ls | wc -l
       0
[anchor=fileinformation][/anchor]top

How to find information about a file, like when it was last modified, updated, accessed:

Linux:
florian@gzlinux:~$ [color=green]stat .profile[/color]
  File: `.profile'
  Size: 774             Blocks: 8          IO Block: 4096   regular file
Device: 806h/2054d      Inode: 7           Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/ florian)   Gid: ( 1000/ florian)
Access: 2012-02-27 09:05:28.000000000 +0100
Modify: 2011-09-05 11:57:35.000000000 +0200
Change: 2011-09-05 11:57:35.000000000 +0200
AIX:
[gzaix:root:/home/root:] [color=green]istat .profile[/color]
Inode 96 on device 10/8 File
Protection: rw-r--r--   
Owner: 0(root)          Group: 0(system)
Link count:   1         Length 129 bytes

Last updated:   Thu Nov  4 14:33:25 2010
Last modified:  Thu Aug 12 11:25:50 2010
Last accessed:  Mon Feb 27 09:56:24 2012
[anchor=preventsshtimeout][/anchor]top

How to prevent timeouts in SSH

Server side:
Add the following two lines to /etc/ssh/sshd_config:
ClientAliveInterval 30
ClientAliveCountMax 4
Client side:
Add the following two lines to /etc/ssh/ssh_config (or $HOME/.ssh/config if you don't have root access):
ServerAliveInterval 30
ServerAliveCountMax 4
[anchor=setupsshkeys][/anchor]top

How to set up ssh keys:

1. On the client use the following command to generate a dsa key (if you prefer rsa, use it instead):ssh-keygen -t dsa 2. Copy the generated key to the .ssh/authorized_keys to the server where you want to log in without password. The key file is normally ~/.ssh/id_dsa.pub. [anchor=listpasswdperl][/anchor]top

How to get a list of users from /etc/passwd with perl:

# perl -p -e '$_ = (split(/[:\n]/))[0] . "\n"' /etc/passwd | xargs
[anchor=extract001][/anchor]top

How to unzip/unrar/extract .001 files:

florians-MacBook-Pro:ARCH florian$ ls -la
total 14458152
drwxr-xr-x  79 florian  florian       2686 Mar 30 11:42 .
drwxr-xr-x@  7 florian  florian        238 Mar 30 09:17 ..
-rw-r--r--@  1 florian  florian       6148 Mar 30 11:31 .DS_Store
-rw-r--r--@  1 florian  florian  100000000 Mar 30 12:46 flt-binb.001
-rw-r--r--@  1 florian  florian  100000000 Mar 30 08:55 flt-binb.002
[...]
-rw-r--r--@  1 florian  florian  100000000 Mar 30 08:46 flt-binb.074
-rw-r--r--@  1 florian  florian    2270390 Mar 30 03:36 flt-binb.075
-rw-r--r--@  1 florian  florian       1725 Mar 29 22:58 flt-binb.sfv
florians-MacBook-Pro:DVD2 florian$ [color=green][b]7z e flt-binb.001 [/b][/color]

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=utf8,Utf16=on,HugeFiles=on,4 CPUs)

Processing archive: flt-binb.001

Extracting  flt-binb.iso

Everything is Ok

Size:       8543797248
Compressed: 7402270390
[anchor=usernamefromrealname][/anchor]top

How to find out the username if you have his real name. This works if GECOS (user information) is filled correctly.

Most LINUX/UNIX (including AIX):
gzaix@root:/home/root # grep -i max /etc/passwd
togex:!:216:1:RO/C//GZM/Toge.Max APPLI:/home/togex:/usr/bin/ksh
AIX:
gzaix@root:/home/root # lsuser -a gecos ALL | grep -i max     
megot gecos=RO/C//GZM/Toge.Max APPLI
[anchor=bashgeneraterandomnumber][/anchor]top

How to generate random number in bash:

jupiter:~# echo $[ 1 + $[ RANDOM % 10 ]]
1
jupiter:~# echo $[ 1 + $[ RANDOM % 10 ]]
2
jupiter:~# echo $[ 1 + $[ RANDOM % 10 ]]
4
jupiter:~# echo $[ 1 + $[ RANDOM % 10 ]]
6
[anchor=rdesktopspeedup][/anchor]top

How to speedup rdesktop session via linux command line:

This is simple, you just have to add -P and -z which enables local disk cache and transmission compression. Example of such command with custom resolution and user/password requirement:
florian@florian:~$ /usr/bin/rdesktop 10.8.10.1:2222 -P -z -u vbox -g 1280x750 -E -p -
Autoselected keyboard map en-us
Password: 
WARNING: Remote desktop changed from 1280x750 to 1024x768.

How to wipe disk label of a drive

00:50:21 root@minivm:~# wipefs /dev/sdh
DEVICE OFFSET        TYPE UUID LABEL
sdh    0x200         gpt       
sdh    0x3a3817d5e00 gpt       
sdh    0x1fe         PMBR      
00:50:51 root@minivm:~# wipefs --all /dev/sdh
/dev/sdh: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sdh: 8 bytes were erased at offset 0x3a3817d5e00 (gpt): 45 46 49 20 50 41 52 54
/dev/sdh: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sdh: calling ioctl to re-read partition table: Success
00:51:08 root@minivm:~# wipefs /dev/sdh
00:51:10 root@minivm:~#
00:51:10 root@minivm:~# fdisk -l /dev/sdh
Disk /dev/sdh: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: 2135            
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
[anchor=wipegptpartitiontablembr][/anchor]top

How to wipe partition table / MBR from a drive:

The following disk have GPT partition table and one partition:
[root@florian ~]# fdisk -l /dev/sdb

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x366ade79

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       38914   312571192+  83  Linux
Trying to use DD to wipe the partition table. Actually it only deletes the partion(s):
[root@florian ~]# dd if=/dev/zero of=/dev/sdb bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.263887 s, 1.9 kB/s
[root@florian ~]# fdisk -l /dev/sdb

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
What you have to do in order to achieve this (there are many other ways too):
[root@florian ~]# parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mktable                                                          
New disk label type? msdos                                                
(parted) quit                                                             
Information: You may need to update /etc/fstab.                           

[root@florian ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d4499

   Device Boot      Start         End      Blocks   Id  System
[anchor=wipepartitiontablembr][/anchor]top

How to wipe partition table / MBR from a drive:

Just MBR:
dd if=/dev/zero of=/dev/sda bs=446 count=1
MBR and partitions:
dd if=/dev/zero of=/dev/sda bs=512 count=1
[anchor=exportunexportnfscommand][/anchor]top

How to export/unexport nfs mounts with command, without populating /etc/exports:

exportfs -o rw,sync,mp,fsid=1 192.168.1.0/24:/mnt/fs/to/export
exportfs -u 192.168.1.0/24:/mnt/fs/to/export
[anchor=iowaitprocesses][/anchor]top

How to see the processes with I/O wait (processes in uninterruptible sleep marked with D):

watch -n 1 "ps -eo state,pid,cmd | grep ^D"
[anchor=sortprocessescs][/anchor]top

How to sort processes by context switch number:

watch -n 1 "pidstat -w | sort -k 4n | tail -n 20"
[anchor=monitorprociocpu][/anchor]top

How to monitor processes with I/O wait and cpu usage in the same time:

watch -n 1 "ps -eo state,pid,cmd | grep ^D ; top -b -n 1 -c | head -n 40"
[anchor=satalinkspeed][/anchor]top

How to find the SATA link speed:

Small note before the commands:
SATA REVISION => SPEED ({Gbit|MB}/s) SATA revision 1.0 => 1.5 Gbit/s, 150 MB/s SATA revision 2.0 => 3 Gbit/s, 300 MB/s SATA revision 3.0 => 6 Gbit/s, 600 MB/s SATA revision 3.2 => 16 Gbit/s, 1969 MB/s
Via dmesg:
root@gate:~# [color=green]dmesg | grep -i sata | grep 'link up'[/color]
[    9.603363] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
root@gate:~# [color=green]dmesg | grep -i --color ahci[/color]
[    9.282782] ahci 0000:00:1f.2: version 3.0
[    9.283862] ahci 0000:00:1f.2: irq 40 for MSI/MSI-X
[    9.283917] ahci 0000:00:1f.2: SSS flag set, parallel bus scan disabled
[    9.284069] ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
[    9.284071] ahci 0000:00:1f.2: flags: 64bit ncq stag only ccc 
[    9.284469] scsi0 : ahci
root@gate:~# [color=green]dmesg | grep -i  ahci | grep -i --color Gbps[/color]
[    9.284069] ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
Via messages log:
root@gate:~# [color=green]grep -i SATA /var/log/messages | grep --color -i 'link up'[/color]
Nov 15 16:41:02 gate kernel: [ 1746.589306] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Nov 15 16:48:34 gate kernel: [    9.176402] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Nov 16 04:21:16 gate kernel: [41571.102917] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Nov 16 06:45:45 gate kernel: [    9.707394] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Nov 16 17:00:09 gate kernel: [    9.603363] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Via hdparm:
root@gate:~# [color=green]hdparm -I /dev/sda | egrep "Model|speed|Transport"[/color]
	Model Number:       VBOX HARDDISK                           
	   *	Gen2 signaling speed (3.0Gb/s)
[anchor=keyring][/anchor]top

What to do if you keep getting "Enter password for default keyring to unlock" and the password is not working?

Most probably the keyring is corrupt so unfortunately you will have to remove it. This is how I did it, maybe it works for you too! Source: https://bugzilla.redhat.com/show_bug.cgi?id=344611
florian@florian:~$ ls -la .gnome2/keyrings/
total 12
drwx------.  2 florian florian 4096 Dec  3 12:46 .
drwx------. 18 florian florian 4096 Jan 29  2015 ..
-rw-------.  1 florian florian 148679 Nov 24 10:57 login.keyring
florian@florian:~/.gnome2/keyrings$ rm .gnome2/keyrings/login.keyring
florian@florian:~/.gnome2/keyrings$ 
[anchor=dmesgminuscapitalt][/anchor]top

How to see dmesg timestamp in human readable format

Default timestamp (for robots):

root@minivm:~# dmesg | tail
[2334087.877445] =================================== Tue 06 Apr 2021 10:40:01 PM EEST ===================================
[2334687.896271] =================================== Tue 06 Apr 2021 10:50:01 PM EEST ===================================
[2335287.914795] =================================== Tue 06 Apr 2021 11:00:01 PM EEST ===================================
[2335887.933947] =================================== Tue 06 Apr 2021 11:10:01 PM EEST ===================================
[2336487.959855] =================================== Tue 06 Apr 2021 11:20:01 PM EEST ===================================
[2337087.979591] =================================== Tue 06 Apr 2021 11:30:01 PM EEST ===================================
[2337688.000499] =================================== Tue 06 Apr 2021 11:40:01 PM EEST ===================================
[2338288.021460] =================================== Tue 06 Apr 2021 11:50:01 PM EEST ===================================
[2338888.091328] =================================== Wed 07 Apr 2021 12:00:01 AM EEST ===================================
[2339488.144357] =================================== Wed 07 Apr 2021 12:10:01 AM EEST ===================================

Human readable timestamp:

root@minivm:~# dmesg -T | tail
[Tue Apr  6 22:40:36 2021] =================================== Tue 06 Apr 2021 10:40:01 PM EEST ===================================
[Tue Apr  6 22:50:36 2021] =================================== Tue 06 Apr 2021 10:50:01 PM EEST ===================================
[Tue Apr  6 23:00:36 2021] =================================== Tue 06 Apr 2021 11:00:01 PM EEST ===================================
[Tue Apr  6 23:10:36 2021] =================================== Tue 06 Apr 2021 11:10:01 PM EEST ===================================
[Tue Apr  6 23:20:36 2021] =================================== Tue 06 Apr 2021 11:20:01 PM EEST ===================================
[Tue Apr  6 23:30:36 2021] =================================== Tue 06 Apr 2021 11:30:01 PM EEST ===================================
[Tue Apr  6 23:40:37 2021] =================================== Tue 06 Apr 2021 11:40:01 PM EEST ===================================
[Tue Apr  6 23:50:37 2021] =================================== Tue 06 Apr 2021 11:50:01 PM EEST ===================================
[Wed Apr  7 00:00:37 2021] =================================== Wed 07 Apr 2021 12:00:01 AM EEST ===================================
[Wed Apr  7 00:10:37 2021] =================================== Wed 07 Apr 2021 12:10:01 AM EEST ===================================
  • Log in to post comments
  • 20408 views

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!
Or at least link back to this website.

Popular content

Today's:

  • PHP2Shell: Critical PHP Remote Code Execution Vulnerabilities
  • Drupal 7 to Drupal 10 Migration and Configuration Notes
  • How to test ethernet speed with iperf
  • Assetto Corsa Rally vs Real Life – La Bollène-VĂ©subie → Col de Turini | Monte-Carlo Rally
  • €6,000 MacBook Pro: Should I Throw It Away After 6 Years?
  • AIX FS Commands
  • CygWin World
  • CygWin Tips and Tricks
  • How to shrink a reiserfs LVM partition
  • ESXi: How to create a bootable USB installer of ESXi 7.0

All time:

  • Linux Networking: How to disable/enable offload features, RX/TX checksum, scatter, gather and beyond
  • Tivoli Storage Manager Client Commands (dsmc commands)
  • Centrify Useful Commands and Information
  • Run ZIM on OS X and create Zim.app
  • How to be sure network interfaces have always the same names
  • Linux backup/restore/reinstall
  • How to add exfat support on RHEL 6
  • Mafia II Joe's Adventures - Playboy Locations
  • HMC commands
  • Command Line Software Update in MacOS

Last viewed:

  • PHP2Shell: Critical PHP Remote Code Execution Vulnerabilities
  • How to shrink a reiserfs LVM partition
  • How to test ethernet speed with iperf
  • OS X - How to change audio output from Menubar
  • Linux: keepalive or not
  • The TCL 34R83Q is Insane! But There’s a Catch. Honest Review About a Real Product. Read Description.
  • Error: CarbonHeaders is an obsolete port. Please uninstall it.
  • Drupal 7 to Drupal 10 Migration and Configuration Notes
  • EA Sports WRC vs Assetto Corsa Rally | Visual Comparison in Ultra Wide (Gravel, Asphalt, Wet, Night, Snow)
  • ESXi: How to create a bootable USB installer of ESXi 7.0