cp /usr/lib/systemd/system/[email protected] /usr/lib/systemd/system/[email protected]
update file: [/usr/lib/systemd/system/[email protected]]
add in the line ExecStart= -a USERNAMe after --noclear
example:
git config --global alias.lg 'log --all --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset" --abbrev-commit' |
cp /usr/lib/systemd/system/[email protected] /usr/lib/systemd/system/[email protected]
update file: [/usr/lib/systemd/system/[email protected]]
add in the line ExecStart= -a USERNAMe after --noclear
example:
dnsmasq -z --dhcp-range=192.168.0.50,192.168.0.199,255.255.255.0 --interface=tap100 --except-interface=lo --listen-address=192.168.0.3 | |
-dhcp-range=<start>,<end>,<mask> | |
-listen-address=<ip of interface> |
#commandline | |
ssh -o ProxyCommand='nc -x localhost:5000 %h %p ' {destination} | |
#~/.ssh/config | |
ProxyCommand ssh {destination} -W %h:%p |
static int current_cpu = -1; | |
int max_cpus = 8 * sizeof(cpu_set_t); | |
cpu_set_t m; | |
CPU_ZERO(&m); | |
sched_getaffinity(0, sizeof(cpu_set_t), &m); | |
for (int i = 0; i < max_cpus; ++i) { | |
int c = (current_cpu + i + 1) % max_cpus; | |
if (CPU_ISSET(c, &m)) { | |
CPU_ZERO(&m); | |
CPU_SET(c, &m); |
du -h --max-depth=1 $HOME 2>/dev/null | grep '[0-9\.]\+G' |
my_serv=$1 | |
net_id=$(docker service inspect --format '{{.Endpoint.VirtualIPs}}' $my_serv | cut -c 3- | cut -d ' ' -f 1) | |
net_name=$(docker network inspect --format '{{.Name}}' $net_id) | |
docker service ps --format '{{.ID}} {{.Node}}' $my_serv | | |
while read serv_id node_id; | |
do | |
cont_id=$(docker inspect --format '{{.Status.ContainerStatus.ContainerID}}' $serv_id 2> /dev/null) | |
node_ip=$(docker node inspect $node_id --format '{{ .Status.Addr }}' 2> /dev/null) | |
cont_ip=$(docker -H $node_ip inspect --format '{{index .NetworkSettings.Networks "'$net_name'" "IPAddress"}}' $cont_id 2> /dev/null) |