Rexxer

Some tips for me and other

News

Extract a text between delimiters with sh instead of using regex

Example file: UNKNOWN[123.21.181.4] abts-tn-dynamic-161.155.174.122.airtelbroadband.in[122.174.155.161] fm-dyn-118-137-18-160.fast.net.id[118.137.18.160] UNKNOWN[118.69.71.76] ip-177.71.93.43.juniornet.psi.br[177.71.93.43] UNKNOWN[210.245.34.254] UNKNOWN[185.140.242.41] I want to extract IP-addresses: command shell: cat drop.txt | cut -d'[‘ -f2 | cut -d’]’ -f1 Get data from the file Delete all the text before the delimeter (we choose the text after the delimiter) Delete alle the text after the delimeter ( … before […]

Zabbix + reset password for the web interface

update zabbix.users set passwd=md5(‘mynewpassword’) where alias=’Admin’;

Windows 7 + shell commands for consoles

Shell commands list for Windows 7 Обнаружение беспроводных сетей – rundll32.exe van.dll,RunVAN Настройка беспроводной сети – RunDll32.exe shell32.dll,Control_RunDLL NetSetup.cpl,@0,WNSW Управление беспроводными сетями – explorer.exe shell:::{1fa9085f-25a2-489b-85d4-86326eedcd87} Архивация и восстановление – sdclt.exe /restorewizardadmin Восстановление файлов – sdclt.exe /restorewizard Настройка системы архивации – sdclt.exe /configure Добавление сетевого расположения – rundll32.exe shwebsvc.dll,AddNetPlaceRunDll Параметры индексирования – control.exe srchadmin.dll Настройка значков […]

Gitlab + maintenance

Maintenance Rake Tasks Gather information about GitLab and the system it runs on This command gathers information about your GitLab installation and the System it runs on. These may be useful when asking for help or reporting issues. Source: https://docs.gitlab.com/ce/administration/raketasks/maintenance.html Omnibus Installation sudo gitlab-rake gitlab:env:info Source Installation bundle exec rake gitlab:env:info RAILS_ENV=production Example output: System […]

WGET + Measure for web

wget -E -H -p -Q300K –user-agent=Mozilla –no-cache –no-cookies –no-check-certificate –delete-after –timeout=15 –tries=2 yoursite.com 2>&1 | grep Downloaded

Windows Update + CheckSUR

If you have issues with updating Windows or installing some components you can try CheckSUR: http://support.microsoft.com/kb/947821/en-us Using: DISM.exe /Online /Cleanup-image /Scanhealth DISM.exe /Online /Cleanup-image /Restorehealth or DISM.exe /Online /Restorehealth

Skype for Business tricks

Add ?SL= at the end of the URL and give the meeting link to the external user(s). By adding ?SL= to the URL, the external user will be forced to use the Skype for Business Web App. Source: https://blog.zubairalexander.com/allowing-external-users-to-join-your-skype-for-business-meetings/

Powershell + MySQL

Interesting script and MySQL connector for powershell: Script: Param( [Parameter( Mandatory = $true, ParameterSetName = ”, ValueFromPipeline = $true)] [string]$Query ) $MySQLAdminUserName = ‘username’ $MySQLAdminPassword = ‘password’ $MySQLDatabase = ‘MySQL-DB’ $MySQLHost = ‘MySQL-Host’ $ConnectionString = “server=” + $MySQLHost + “;port=3306;uid=” + $MySQLAdminUserName + “;pwd=” + $MySQLAdminPassword + “;database=”+$MySQLDatabase Try { [void][System.Reflection.Assembly]::LoadWithPartialName(“MySql.Data”) $Connection = New-Object MySql.Data.MySqlClient.MySqlConnection […]

Zabbix + Check your user parameters

To check your user parameters you can use the utility from zabbix client: zabbix_get I have some issues with my user parameter and ran the command: zabbix_get -s localhost -k “MyUserParameter” and got: ZBX_NOTSUPPORTED: Timeout while executing a shell script. I went to the zabbix_client.conf and set the timeout to 15. Now everything is OK […]

Exchange + Remove messages from outbound queue

Remove-Message -Filter {Subject -eq “FYI”} -WithNDR $false Remove-Message -Filter {FromAddress -eq “j.smith@mail.com”} -WithNDR $false

Previous Posts