debug method development with “ls” command

$gdb /bin/ls GNU gdb (Debian 7.11.1-2) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type “show copying” and “show warranty” for details. This GDB was …

compressing and uncompressing a file with the help of xargs

$ls stderr.txt stderr.txt $ls stderr.txt | xargs ls stderr.txt $ls stderr.txt | xargs cat /home/jeffrin/quark/kernel/run_kernel.sh: line 10: ./main.native: No such file or directory $ls stderr.txt | xargs gzip $ls stderr.txt ls: cannot access ‘stderr.txt’: No such file or directory $ls stderr.txt.gz | xargs gunzip $ls stderr.txt stderr.txt $

Finding the number of processor units

ABOUT nproc print the number of processing units available TYPICAL COMMANDLINE SESSION [bash] $nproc 2 $nproc –ignore=1 1 $grep -c ^processor /proc/cpuinfo 2 $cat /proc/cpuinfo | awk ‘/^processor/{print $3=$3+1}’ | tail -1 2 $cat /proc/cpuinfo | awk ‘/^processor/{print $3}’ 0 1 $lscpu | grep CPU CPU op-mode(s): 32-bit, 64-bit CPU(s): 2 On-line CPU(s) list: 0,1 …

finding the current state of a network cable

$sudo cat /sys/class/net/eth0/speed 100 $sudo cat /sys/class/net/eth0/ca carrier carrier_changes $sudo cat /sys/class/net/eth0/carrier 1 $sudo cat /sys/class/net/eth0/carrier_changes 2 $sudo cat /sys/class/net/eth0/operstate up $sudo ethtool eth0 Settings for eth0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full …

httping with sending of username and password and flood ping

$httping -U www.beautifulwork.org No URL/host to ping given $httping -U http://www.beautifulwork.org No URL/host to ping given $httping http://www.beautifulwork.org PING www.beautifulwork.org:80 (/): connected to 89.36.208.169:80 (224 bytes), seq=0 time=455.10 ms connected to 89.36.208.169:80 (224 bytes), seq=1 time=458.34 ms connected to 89.36.208.169:80 (224 bytes), seq=2 time=447.45 ms ^CGot signal 2 — http://www.beautifulwork.org/ ping statistics — 4 connects, …

anonymous pages and memory from /proc/meminfo

$cat /proc/meminfo MemTotal: 3495924 kB MemFree: 1465276 kB MemAvailable: 2353604 kB Buffers: 126008 kB Cached: 962924 kB SwapCached: 0 kB Active: 1330576 kB Inactive: 452848 kB Active(anon): 695532 kB Inactive(anon): 29420 kB Active(file): 635044 kB Inactive(file): 423428 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 7259132 kB SwapFree: 7259132 kB Dirty: 232 kB Writeback: 0 …

sample session with “shopt -s cdspell” with Bash

$shopt -s checkwinsize on cmdhist on complete_fullquote on expand_aliases on extglob on extquote on force_fignore on histappend on interactive_comments on progcomp on promptvars on sourcepath on $shopt -s cdspell $shopt -s cdspell on checkwinsize on cmdhist on complete_fullquote on expand_aliases on extglob on extquote on force_fignore on histappend on interactive_comments on progcomp on promptvars on …

appending file using “paste” command hack

$cat a.txt hello $cat b.txt killo $ls 1 a.txt b.txt l.txt trueangle u.txt $cat u.txt UPPERCASE $cat l.txt uppercase $cat a.txt >> b.txt >> l.txt >> u.txt $cat u.txt UPPERCASE hello $cat a.txt hello $cat 1 a.txt b.txt l.txt trueangle/ u.txt $cat l.txt uppercase $cat a.txt hello $cat a.txt >> b.txt $cat b.txt killo hello …