This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ErrorLog "logs/error.log" | |
#rotate every 2 minutes | |
ErrorLog "|bin/rotatelogs.exe -p C:/.../zip_logs.bat -l logs/errorlog.%Y-%m-%d-%H_%M_%S.log 120" | |
# or rotate every 20Mb | |
ErrorLog "|bin/rotatelogs.exe -p C:/.../zip_logs.bat -n 20 logs/error.log 20M" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var soap = require('soap') | |
global.window.soap = soap | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add to C:/Users/yourUser/.ssh/config: <= if you don't have .ssh folder, just do a ssh-gen in cmd | |
``` | |
Host github_kiosker | |
HostName github.com | |
User git | |
IdentityFile C:/Users/Dev/.ssh/key.pem | |
``` | |
then in cmd, you can clone using: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this uses docker-compose service name, not container | |
containername="$1" | |
docker-compose exec $containername bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir strace_210618 | |
cd strace_210618 | |
ps aux | grep fpm | |
strace -o fpm.txt -ffF -ttT -p <pid1,pid2,pid3....> | |
strace-log-merge fpm.txt > fpm_sorted.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ln="$1" | |
containername=`docker ps --format "{{.Names}}" | awk "FNR == $1"` | |
echo $containername | |
docker exec -it $containername bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# != 2 ]; then | |
echo "Usage: googledown.sh ID save_name" | |
exit 0 | |
fi | |
confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id='$1 -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p') | |
echo $confirm | |
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$confirm&id=$1" -O $2 && rm -rf /tmp/cookies.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
from ipaddress import IPv4Interface, IPv6Interface | |
def main(): | |
print("Getting ip") | |
# WSL_NIC = getWSLInterface() | |
proc = os.popen("wsl /sbin/ip -o -4 addr list eth0:1") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start with one random point in first cluster. | |
"Grow" the cluster to near neighbors (below threshold). | |
Repeat until all cluster is discovered. | |
Then start with new cluster. | |
Agglomerate small clusters at the end | |
Benefits: | |
Unsupervised clustering (not need to supply k like in kmeans). | |
Drawbacks: |