-
-
Save nutrino/02fb597826cb0d8a6cf1c00c3815ade1 to your computer and use it in GitHub Desktop.
| # https://news.hada.io/topic?id=7286 | |
| alias df='df -h -x tmpfs -x devtmpfs -x squashfs' | |
| alias xc='xclip -sel clipboard' | |
| alias ttfb='curl -so /dev/null -w "HTTP %{http_version} %{http_code} Remote IP: %{remote_ip}\nConnect: %{time_connect}\nTTFB: %{time_starttransfer}\nTotal time: %{time_total}\nDownload speed: %{speed_download}bps\nBytes: %{size_download}\n"' | |
| ap() { | |
| https $@ Accept:application/activity+json | |
| } | |
| shodan() { | |
| xdg-open https://shodan.io/domain/$1 | |
| dig +short $1 | xargs -i xdg-open https://shodan.io/host/{} | |
| } | |
| check_mtu() { | |
| local target=$1 | |
| shift | |
| local lower=0 | |
| local upper=1500 | |
| until [[ $((lower + 1)) -eq $upper ]]; do | |
| current=$(((lower + upper) / 2)) | |
| echo -n "lower: $lower, upper: $upper, testing: $current -- " | |
| if ping -M do -s $current -c 2 -i 0.2 $target $@ &>/dev/null; then | |
| echo "ok" | |
| lower=$current | |
| else | |
| echo "fail" | |
| upper=$current | |
| fi | |
| done | |
| echo "max packet size: $lower, mtu: $((lower + 28))" | |
| } | |
| # https://news.hada.io/topic?id=9118 | |
| killport() { | |
| if [ $# -ne 0 ]; then | |
| for port in "$@"; do | |
| pids=$(lsof -ti ":$port") | |
| if [ -n "$pids" ]; then | |
| echo "Processes listening on port $port: $pids" | |
| echo "$pids" | xargs kill -9 >/dev/null 2>&1 | |
| echo "Processes listening on port $port have been terminated" | |
| else | |
| echo "No process found listening on port $port" | |
| fi | |
| done | |
| else | |
| echo "No arguments provided" | |
| fi | |
| } |
lsof -i -P | grep -i "listen"
lsof -t -i TCP:8080 | xargs kill -9
netstat -an |grep LISTEN
nmcli connection show
#!/bin/bash
if [ -z "$1" ]; then
echo "sudo yumoffline.sh [packageName]"
exit 1
fi
if [ "$EUID" -ne 0 ]
then echo "Please run as root (sudo yumoffline.sh [packageName])"
exit
fi
set -x #echo on
Ubuntu Network
ip addr set enp4s0 up
nmtui
sudo lshw -C network
Boot kernel log
dmesg
sudo nano /etc/systemd/system/autostart-mount.service
[Unit]
Description=Mount Share at boot
After=network.target
[Service]
User=root
ExecStart=/bin/mount -a
ExecStartPre=/bin/sleep 10
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo nano /etc/systemd/system/jupyterlab.service
[Unit]
Description=JupyterLab
After=syslog.target network.target
[Service]
User=root
Environment="PATH=/usr/local/bin:/usr/bin:/bin"
ExecStart=/usr/local/bin/jupyter lab --ip 0.0.0.0 --port 8888 --no-browser --allow-root
#ExecStart=/usr/local/bin/jupyter notebook --ip 0.0.0.0 --port 8888 --no-browser --allow-root
#ExecStart=/usr/local/bin/jupyterhub --ip 0.0.0.0 --port 8888
ExecStartPre=/bin/sleep 20
[Install]
WantedBy=multi-user.target
script -c "ls --color=auto" output.txt
change wayland to X11
rustdesk/rustdesk#670
sudo nano /etc/gdm3/custom.conf
systemctl status display-manager.service
du -h --max-depth=1 | sort -hr
find . -name "*.txt" -exec du -h {} + | sort -hr