Skip to content

Instantly share code, notes, and snippets.

@phnahes
phnahes / windows-serial.bat
Created April 15, 2020 14:23
Find Windows 10 Product Key on a New Computer
# 1- Press Windows key + X
# 2- Click Command Prompt (Admin)
# 3- Type command below:
wmic path SoftwareLicensingService get OA3xOriginalProductKey
@phnahes
phnahes / td-agent.conf
Created April 8, 2020 13:26
Fluentd configuration for dnsquery logs
<source>
@type tail
path "/var/log/named/dnsquery.log"
pos_file "/var/log/td-agent/dnsquery.pos"
tag "es.dnsquery"
format /^(?<time>[^ ]* [^ ]*) [^.]* (?<ip>[^ ][^#]*).(?<port>[^ ][^ ]*). [^ ]* [^ ]* (?<fqdn>[^ ]*) (?<rectype>[^ ]* [^ ]* [^ ]*) (?<dnsserver>[^ ]*\d*)$/
time_format %d-%b-%Y %H:%M:%S.%L
</source>
<match es.**>
@phnahes
phnahes / m2070.md
Last active January 10, 2025 11:45
Printer Samsung M2070 working on Raspberry (armhf)

Install Cups

apt install cups samba cups-ipp-utils

Install Drivers

Download the Samsung ULD (Unified Linux Driver) version 1.00.29 from the SULDR website (the latest one on Samsung's website doesn't have an arm directory)

wget https://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-1.00.29.tar.gz

@phnahes
phnahes / serialmonitor.sh
Last active March 27, 2020 20:24
putty - cli to show serial monitor
# Enter on cmd
putty -serial COM3 -sercfg 115200,8,n,1,N
@phnahes
phnahes / remove_newline.sh
Last active March 11, 2020 16:51
[SED] remove new line using sed and bash
cat file.txt | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g'