Skip to content

Linux – tcpdump capture network packets

tcpdump tcpdump is a Linux program that can be used to capture network traffic to and from a Linux server and it’s clients. It is well-docmented and needs no further description. This post just describes… 

Python – local http server

Install Python for windows F:\>python -m http.server Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) … then connect via a browser with URL http://localhost:8000 The current directory is served in the browser

SQL Server – Truncate transaction log

The transaction log is truncated when a transaction log backup is executed (recovery mode Full). In an emergency situation, if the log becomes full and it is not possible to backup the log normally, it… 

SQL Server – Monitor Log Space

DBCC SQLPERF(logspace) ———————————————————————————————- DECLARE @sql_command varchar(1024) DECLARE @logtable TABLE ( [Database Name] VARCHAR(1000) NULL, [Log Size (MB)] numeric, [Log Space Used (%)] numeric, [Status] VARCHAR(128) NULL ) SELECT @sql_command = ‘dbcc sqlperf (logspace)’ INSERT INTO… 

Linux – install hstr for hh command recall

yum install gcc yum install readline-devel yum install ncurses-devel ncurses wget https://github.com/dvorka/hstr/releases/download/1.10/hh-1.10-src.tgz tar xf hh-1.10-src.tgz cd hstr ./configure && make && sudo make install

Oracle ASM – List ASM files

SELECT concat(‘+’||gname, sys_connect_by_path(aname, ‘/’)) full_path, gnumber group_number, gname group_name, file_number, system_created, nvl(file_type, ‘Directory’) file_type, decode(file_type, null, ‘N’, decode (system_created, ‘N’, ‘Y’, ‘N’)) file_alias, block_size, blocks, bytes, space, redundancy, striped, creation_date, modification_date , redundancy_lowered FROM (SELECT… 

Oracle – FRA – display usage of flash recovery area

select round(space_used/(1024*1024*1024),2) GBUsed,space_limit/(1024*1024*1024) MaxGB from v$recovery_file_dest — init parameter log_archive_dest_1 must be equal to LOCATION=USE_DB_RECOVERY_FILE_DEST — and db_recovery_file_dest must be set select * from v$flash_recovery_area_usage

postgresql – show sql commands behind shortcuts

Connect with the -E option psql -E ….. Then: postgres=# \du ********* QUERY ********** SELECT r.rolname, r.rolsuper, r.rolinherit, r.rolcreaterole, r.rolcreatedb, r.rolcanlogin, r.rolconnlimit, r.rolvaliduntil, ARRAY(SELECT b.rolname FROM pg_catalog.pg_auth_members m JOIN pg_catalog.pg_roles b ON (m.roleid = b.oid)… 

postgresql – help

psql is the PostgreSQL interactive terminal. Usage: psql [OPTION]… [DBNAME [USERNAME]] General options: -c, –command=COMMAND run only single command (SQL or internal) and exit -d, –dbname=DBNAME database name to connect to (default: “RAYFOX”) -f, –file=FILENAME…