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
@echo off | |
set ip_address_string="IPv4" | |
rem Uncomment the following line when using Windows 7 or Windows 8 / 8.1 (with removing "rem")! | |
rem set ip_address_string="IPv4 Address" | |
for /f "usebackq tokens=2 delims=:" %%f in (`ipconfig ^| findstr /c:%ip_address_string%`) do ( | |
echo Your IP Address is: %%f | |
powershell send_telegram.ps1 -chat_id CHAT_ID -text 'Greetings for %computername% with ip %%f' | |
goto :eof | |
) |
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
#Usage: sendmessage_telegram.ps1 -chat_id CHAT_ID -text 'TEXT' -markdown | |
param( | |
[string]$chat_id = $(Throw "'-chat_id' argument is mandatory"), | |
[string]$text = $(Throw "'-text' argument is mandatory"), | |
[switch]$markdown, | |
[switch]$nopreview | |
) | |
$token = "TOKEN" | |
if($nopreview) { $preview_mode = "True" } |
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 | |
# http://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#easy-way-ubuntu-16-04 | |
#Задаем пароль для пользователя root для MySQL | |
COOKIES_PASSWORD="PASSWORD" | |
#Задаем часовой пояс для PHP | |
TIMEZONE="Asia/Irkutsk" | |
# Настраививаем автоматический ввод пароля для админа mysql. |
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/sh | |
# | |
# Ubuntu 16.04 deploy OpenMeetings | |
# wget -qO - https://gist.github.com/ | bash -s | |
# | |
apt update | |
apt -y install software-properties-common python-software-properties | |
add-apt-repository -y ppa:jonathonf/ffmpeg-3 |
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
:local ttoken "TOKEN"; | |
:local tchatid "CHAT_ID"; | |
:local ttext "\D0\A2\D0\B5\D1\81\D1\82\D0\BE\D0\B2\D0\BE\D0\B5\20\D1\81\D0\BE\D0\BE\D0\B1\D1\89\D0\B5\D0\BD\D0\B8\D0\B5"; | |
:global turl "https://api.telegram.org/bot$ttoken/sendMessage?chat_id=$tchatid&text=$ttext"; | |
#To encode cyrillic symbols, use this or similiar tools: https://www.urldecoder.org/ | |
#And replace "%" to "\" | |
#Example: | |
#"Тестовое сообщение" -> "%D0%A2%D0%B5%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B5%20%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D0%B5" -> "\D0\A2\D0\B5\D1\81\D1\82\D0\BE\D0\B2\D0\BE\D0\B5\20\D1\81\D0\BE\D0\BE\D0\B1\D1\89\D0\B5\D0\BD\D0\B8\D0\B5" | |
/tool fetch url="$turl" mode=https; |
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
@echo off | |
:loop | |
echo testing IP address | |
ping 123.456.78.90 >nul || ( | |
echo ping failure - disconnecting | |
rasdial name_of_your_vpn_connect /disconnect | |
timeout /t 10 /nobreak | |
echo reconnecting | |
rasdial name_of_your_vpn_connect | |
timeout /t 10 /nobreak |
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 | |
# Deploy on Ubuntu 16.04 WordPress CMS | |
# https://www.digitalocean.com/community/tutorials/wordpress-lamp-ubuntu-16-04-ru | |
# https://kaiten.support/how-to-automate-wordpress-and-wp-config-php-creation/ | |
#Задаем пароль для пользователя root для MySQL | |
SQL_PASSWORD="SQL_PASS" | |
DB_NAME="WP_DB_NAME" | |
DB_USER="WP_DB_USER" | |
DB_PASSWORD="WP_DB_PASS" |
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
$name=(Get-WmiObject Win32_OperatingSystem).caption | |
$bit=(Get-WmiObject Win32_OperatingSystem).OSArchitecture | |
$ver=(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId | |
Write-Host $name, $bit, $ver |
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
# https://blogs.technet.microsoft.com/heyscriptingguy/2011/11/13/use-powershell-to-quickly-find-installed-software/ | |
$computername=(get-childitem -path env:computername).value | |
$UninstallKey="SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall" | |
#$UninstallKey="SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" | |
$reg=[microsoft.win32.registrykey]::OpenRemoteBaseKey('LocalMachine',$computername) | |
$regkey=$reg.OpenSubKey($UninstallKey) | |
$subkeys=$regkey.GetSubKeyNames() | |
$array = @() | |
foreach($key in $subkeys){ |
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
#Script by xaegr (https://xaegr.wordpress.com/2007/01/24/decoder/) | |
#usage: | |
# Get-Content notes.txt | ConvertTo-Encoding "windows-1251" "koi8-r" | Set-Content decoded.txt | |
# command | ConvertTo-Encoding cp866 windows-1251 | |
function ConvertTo-Encoding ([string]$From, [string]$To){ | |
Begin{ | |
$encFrom = [System.Text.Encoding]::GetEncoding($from) | |
$encTo = [System.Text.Encoding]::GetEncoding($to) | |
} |