vi /root/.bashrc
myname=`who am i | awk '{print $1}'` PROMPT_COMMAND='history -a >(logger -p local2.info -t "$myname $USER[$PWD] $SSH_CONNECTION")'
vi /etc/rsyslog.conf
$umask 0000
$FileCreateMode 0666
local2.info /var/log/usercommands
$umask 0077
Notes to myself
vi /root/.bashrc
myname=`who am i | awk '{print $1}'` PROMPT_COMMAND='history -a >(logger -p local2.info -t "$myname $USER[$PWD] $SSH_CONNECTION")'
vi /etc/rsyslog.conf
$umask 0000
$FileCreateMode 0666
local2.info /var/log/usercommands
$umask 0077
GiGl (Glycemic index/Glycemic load) is an app that I developed for personal usage. It is a fast way to check the expected response of your body to most of the commonly available foods. Key points:
In my latest project (API endpoint based on Symfony and api-platform), I have the task to optimize and automate CI/CD processes. As a result: here is super-simplified version of the resulting GitLab pipiline:
Continue reading “CI/CD Symfony 4 with GitLab”
After detecting spammers with an RBL list you can block them for a predefined period of time with the help of fail2ban. How does it work:
– fail2ban parses mail.log
– when a spammer IP is found it is added to a temporary list
– future requests from the spammer’s IP is blocked Continue reading “Fighting SPAM with postfix and fail2ban”
It is a little bit tricky to run winscp command. Here is a working example:
@echo off "C:\Path\WinSCP.com" ^ /log="C:\Path\WinSCP.log" /ini=nul ^ /command ^ "open sftp://username@sftp.bloomberg.com/ -hostkey=""ssh-rsa 2048 AA:BB:CC:DD:EE:FF:AA:BB:CC:DD:EE:FF:00:00:00:00"" -privatekey=""C:\Path\bloomberg.ppk""" ^ "synchronize -filemask=""|/bin/;/etc/"" local ""SFTP"""^ "exit" set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Error ) powershell -file sync2r.ps1 exit /b %WINSCP_RESULT%
/etc/rc.local
screen -d -m /home/mdt/project1/scripts/run_workers.sh
/home/mdt/project1/scripts/run_workers.sh
su mdt -c '/home/mdt/project1/app/console supertag:gearman:run-worker --env=prod 2>&1 | while read line; do echo `/bin/date` "$line" >> /home/mdt/project1/app/logs/worker.log; done'
Basic command:
diskspd.exe -b64K -d60 -h -L -o2 -t4 -r -w50 -c512M z:\io2.dat
raw data: Continue reading “Testing IO performance with variable block size on NTFS and REFS”
Here is a schematic diagram of connecting Meitrack GPS to control Webasto parking heater.
You can turn it on/off with the following SMS:
0000,C01,20,22221
0000,C01,20,22220
Or use some web app…
Continue reading “Control Webasto Parkin Heater with Meitrack GPS”
Change local admin password on multiple machines with PowerShell.
$computers = "srv1","srv2","srv3" $adminPassword = "PAssW00rrrDdd123" $logfile = "log.txt" $ErrorActionPreference = 'stop' ForEach ($computerName in $computers){ Try { $adminUser = [ADSI] "WinNT://$computerName/Administrator,User" $adminUser.SetPassword($adminPassword) } Catch { "$(get-date) :: Server:$($computerName) :: $($error[0].exception)" | Out-File -append $logfile } }
Import-Module "C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1" ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath C:\Users\milan\Downloads\bitnami-redmine-3.4.2-4-linux-debian-8-x86_64\bitnami-redmine-3.4.2-4-linux-debian-8-x86_64-disk1.vmdk -VhdType DynamicHardDisk -VhdFormat vhdx -destination .\redmine.vhdx