Skip to content

Instantly share code, notes, and snippets.

View laudai's full-sized avatar

laudai

View GitHub Profile

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@laudai
laudai / ServaAsset.inf
Last active March 23, 2022 16:51
ServaAsset.inf on Ubuntu 20.04
[PXESERVA_MENU_ENTRY]
asset = Ubuntu LTS 20.04 Desktop Live
platform = amd64
kernel_bios = /NWA_PXE/$HEAD_DIR$/casper/vmlinuz
append_bios = showmounts toram root=/dev/cifs initrd=/NWA_PXE/$HEAD_DIR$/casper/initrd boot=casper netboot=cifs nfsroot=//$IP_BSRV$/NWA_PXE_SHARE/$HEAD_DIR$ NFSOPTS=-ouser=serva,pass=avres,sec=ntlmv2,vers=2.0,ro ip=dhcp ro ipv6.disable=1
kernel_efi64 = /NWA_PXE/$HEAD_DIR$/casper/vmlinuz
append_efi64 = showmounts toram root=/dev/cifs initrd=/NWA_PXE/$HEAD_DIR$/casper/initrd boot=casper netboot=cifs nfsroot=//$IP_BSRV$/NWA_PXE_SHARE/$HEAD_DIR$ NFSOPTS=-ouser=serva,pass=avres,sec=ntlm,vers=1.0,ro ip=dhcp ro ipv6.disable=1
# SPDX-License-Identifier: GPL-2.0-only
################################################################################
#
# r8125 is the Linux device driver released for Realtek 2.5Gigabit Ethernet
# controllers with PCI-Express interface.
#
# Copyright(c) 2021 Realtek Semiconductor Corp. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
# invoke insmod with all arguments we got
# and use a pathname, as insmod doesn't look in . by default
TARGET_PATH=$(find /lib/modules/$(uname -r)/kernel/drivers/net/ethernet -name realtek -type d)
if [ "$TARGET_PATH" = "" ]; then
TARGET_PATH=$(find /lib/modules/$(uname -r)/kernel/drivers/net -name realtek -type d)
fi
@laudai
laudai / guess_sequence.py
Last active April 2, 2021 16:06
Questen : feed a sequence, it will be an any sequence. Please answer the following 10 numbers.
#!/usr/bin/env python
# encoding: utf8
# Author : laudai
# codestyle : black
from typing import List, Tuple
import sys
"""
@laudai
laudai / tmux 3.0a-keybindings-useful-zh_TW.md
Last active January 1, 2021 17:00
tmux 3.0a-keybindings-useful-zh_TW

tmux 3.0a 常用快捷鍵中文版說明

是否需要Prefix 按鍵 英文指令 中文說明
C-b send-prefix 送出 prefix
c new-window 新增 window
d detach-client 暫時離開此 session
" split-window 水平切割 window
% split-window -h 垂直切割 window
n next-window 下一個 window
@laudai
laudai / tmux-keybindings-overall.txt
Last active December 28, 2020 03:38
tmux 3.0a - keybindings
bind-key -T copy-mode C-Space send-keys -X begin-selection
bind-key -T copy-mode C-a send-keys -X start-of-line
bind-key -T copy-mode C-b send-keys -X cursor-left
bind-key -T copy-mode C-c send-keys -X cancel
bind-key -T copy-mode C-e send-keys -X end-of-line
bind-key -T copy-mode C-f send-keys -X cursor-right
bind-key -T copy-mode C-g send-keys -X clear-selection
bind-key -T copy-mode C-k send-keys -X copy-end-of-line
bind-key -T copy-mode C-n send-keys -X cursor-down
bind-key -T copy-mode C-p send-keys -X cursor-up
@laudai
laudai / pysyslog.py
Created October 20, 2018 06:33 — forked from marcelom/pysyslog.py
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
@laudai
laudai / README.md
Created August 4, 2018 08:57 — forked from guillaumevincent/README.md
Windows Service with Python 3.5 and pyinstaller
@laudai
laudai / checkDockerDisks.sh
Created May 1, 2018 12:59 — forked from robsonke/checkDockerDisks.sh
This Bash script will loop through all running docker containers on a host and list the disk usage per mount. In case it's breaching the 65%, it will email you.
#!/bin/bash
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
host=$(hostname)
# loop through all containers
for container in $containers
do
echo "Container: $container"