Commands - jrwhetse/jrwhetse.github.io GitHub Wiki

NMAP

nmap --script ssl-cert,ssl-enum-ciphers -p 443 <fqdn>

Reset weblogic admin password

https://community.oracle.com/thread/2437779?tstart=0

Change file permissions on all files in all directories

find . -type f -name '*.ext' -exec chmod 644 '{}' \+

Change dir permissions on all directories

find . -type d -name '*.ext' -exec chmod 755 '{}' \+

To find the biggest files or directories on Linux, use the following command.

du -Sh | sort -rh | head -n 15

If you want to find the biggest files only (but not directories), use the following command instead.

find . -type f -exec du -Sh {} + | sort -rh | head -n 15

more finding large files

du -ah . | grep -v "/$" | sort -rh | head -50

List packages by installation date

rpm -qa --qf '%{INSTALLTIME} (%{INSTALLTIME:date}): %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -n

unpack rpm

rpm2cpio <rpm>.rpm | cpio -idmv

find string in files

find <location> -type f -exec grep -q <string> {} \; -print

list all installed rpms by name

rpm -qa --queryformat "%{NAME}\n" > /tmp/installed-packages.log

install all rpms by name

yum reinstall -y $(cat installed-packages.log)

show all installed gpg keys

rpm -qi 'gpg-pubkey-*'

show summary info

rpm -q --queryformat "%{SUMMARY}\n" gpg-pubkey

amazing rpm fix. Will reinstall package with no checks

rpm -ivh <package> --nomd5 --nodigest --nosignature

get netstat per process

netstat -anp | grep -i <PID>

stuff

for f in *; do echo -n "$f - "; grep "Read timed" $f | wc -l; done

connect to sql server using domain credentials of another domain

http://dba.stackexchange.com/questions/66014/connect-to-sql-server-with-windows-authentication-in-a-different-domain

C:\>runas /netonly /user:<domain>\<username> "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

test logrotate

logrotate -f -d /etc/logrotate.conf

downgrade a collection of packages

yum downgrade glibc\* 
⚠️ **GitHub.com Fallback** ⚠️