Skip to content

Instantly share code, notes, and snippets.

@hieunt79
hieunt79 / fix-linux-sound.md
Last active July 1, 2025 08:45
Fix no sound Linux

Fix no sound

Ubuntu 22

systemctl --user restart pulseaudio

Ubuntu 20

@hieunt79
hieunt79 / system.txt
Last active May 24, 2021 04:39
haproxy
net.ipv4.ip_forward = 1
net.ipv4.ip_nonlocal_bind = 1
net.ipv6.conf.all.forwarding = 1
net.ipv6.ip_nonlocal_bind = 1
fs.file-max = 500000
net.ipv4.tcp_max_syn_backlog = 3240000
net.core.rmem_default = 31457280
net.core.rmem_max = 12582912
net.core.wmem_default = 31457280
net.core.wmem_max = 12582912
@hieunt79
hieunt79 / example.bash
Created November 30, 2020 07:16 — forked from schubert/example.bash
nginx config trick to force specific return code for testing
$ curl -I http://some.local.app.dev/?return=402
HTTP/1.1 402 Payment Required
Server: nginx/1.2.2
Date: Fri, 27 Jul 2012 19:08:19 GMT
Content-Type: text/html
Content-Length: 182
Connection: keep-alive
Keep-Alive: timeout=10
@hieunt79
hieunt79 / kali-2020.4-tips.txt
Last active November 29, 2020 09:25
Tips for installing kali 2020.4
https://techlog360.com/how-to-dual-boot-kali-linux-v2-0-with-windows-10/
1. Unable to mount ... (somethings like cdrom or ...)
https://superuser.com/questions/962926/cant-install-kali-linux-from-usb-fails-to-find-cd-rom-drive
If step "select and install software" failed, just jump to next step.
2. You must have network connection to install cuz some package is missing. If Kali instalation can not detect driver for wifi then plug a ethernet cable
Ref: https://forums.kali.org/showthread.php?46793-Error-with-installing-Kali-Linux-2020-1-on-VMware
3. If no desktop after install:
@hieunt79
hieunt79 / count_request.sh
Created July 31, 2020 03:31
Count rp10m, rph of log file
#!/bin/bash
LOG_FILE=$1
#for hour in 00 01 02 03
#do
# pattern=" $hour"
# rph=`egrep " $hour:" $LOG_FILE | wc -l`
# echo $hour : $rph
#done
@hieunt79
hieunt79 / 01-get-healthcheck.sh
Last active November 26, 2020 06:45
Linux scripts
#!/bin/bash
cd /tmp
ip_list="$@"
while true
clear
tput cup 0 0
do
for ip in $ip_list
@hieunt79
hieunt79 / pageload.sh
Last active November 10, 2020 07:03
Jmeter for delay time
#!/bin/bash
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
DELAY_FOLDER="/delay"
JMETER_BIN_DIR="$DELAY_FOLDER/jmeter/bin"
current=`date "+%s"`
# measure origin test
$JMETER_BIN_DIR/jmeter --nongui --testfile $DELAY_FOLDER/test-plans/origin/test.jmx --logfile $DELAY_FOLDER/test-results/origin/$current-sample.csv > /dev/null &
@hieunt79
hieunt79 / ping_all.sh
Last active April 24, 2020 08:15
ping with timestamp
#!/bin/bash
for ip in {5..12}
do
ping 12.12.12.$ip| while read line; do echo `date` - $line; done >> node.$ip &
done

2. System Performance: Methodologies

2.1 Terminology

  • IOPS: Input/output operations per second is a measure of the rate of data transfer operations. For disk I/O, IOPS refers to reads and writes per second.
  • Throughput: The rate of work performed. Especially in communications, the term is used to refer to the data rate (bytes per second or bits per second). In some contexts (e.g., databases) throughput can refer to the operation rate (operations per second or transactions per second).
  • Response time: The time for an operation to complete. This includes any time spent waiting and time spent being serviced (service time), including the time to transfer the result.
  • latency: A measure of time an operation waiting to be serviced. In some contexts, it can refers to the entire time for an operation, equivalent to response time.
  • Utilization: với các resource cung cấp theo kiểu request, đây là cách đo lường cho mức độ resource đc sử dụng (how busy a resource is), dựa trên thời gian sử