Skip to content

Instantly share code, notes, and snippets.

View cherts's full-sized avatar

Mikhail Grigorev cherts

View GitHub Profile
@cherts
cherts / credssp_allow_unencrypt.bat
Last active November 12, 2019 05:33
CredSSP allow unencrypt
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters\ /v AllowEncryptionOracle /t REG_DWORD /d 2
@cherts
cherts / disable-transparent-hugepages
Created October 8, 2019 14:28
Disable Transparent Huge Pages (THP) in Ubuntu
#!/bin/sh
### BEGIN INIT INFO
# Provides: disable-transparent-hugepages
# Required-Start: $local_fs
# Required-Stop:
# X-Start-Before: mongod mongodb-mms-automation-agent
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Disable Linux transparent huge pages
# Description: Disable Linux transparent huge pages, to improve
@cherts
cherts / generate-ru-locale-on-debian-linux.sh
Created October 8, 2019 14:33
Add ru_RU.UTF-8 locale on Debian
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
locale-gen ru_RU.UTF-8
dpkg-reconfigure locales
@cherts
cherts / git_delete_tag_local_and_remote.sh
Created October 9, 2019 13:07
Git: Delete local and remote tag
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@cherts
cherts / zbx_440_opdata_remove_bracket.patch
Created October 14, 2019 05:31
Patch for Zabbix v4.4.0 to remove bracket in operational data
--- frontends/php/app/views/monitoring.widget.problems.view.php.orig 2019-10-14 01:13:02.104862978 -0400
+++ frontends/php/app/views/monitoring.widget.problems.view.php 2019-10-14 01:23:01.615655216 -0400
@@ -197,7 +197,7 @@
];
if ($show_opdata == OPERATIONAL_DATA_SHOW_WITH_PROBLEM && $opdata) {
- $problem_link = array_merge($problem_link, [' (', $opdata, ')']);
+ $problem_link = array_merge($problem_link, [' ', $opdata]);
}
@cherts
cherts / win10_without_hyper-v.bat
Last active October 20, 2019 10:22
Adding new boot entry in Windows 10 boot menu (Windows 10 without Hyper-V)
rem Copy curent boot config to "Windows 10 without Hyper-V"
bcdedit /copy {current} /d "Windows 10 without Hyper-V"
rem Edit new config, set disable hyper-v support
bcdedit /set {cbd611ae-f320-11e9-9800-b8aeedea1201} hypervisorlaunchtype off
rem Set new config is default
bcdedit /default {cbd611ae-f320-11e9-9800-b8aeedea1201}
rem Set timeout
@cherts
cherts / DBS-003.patch
Created October 31, 2019 16:22
[DBS-003] Patch for Zabbix v4.4.0 to added Latest data in host settings page
[DBS-003] Patch for Zabbix v4.4.0 to added Latest data in host settings page
--- frontends/php/include/html.inc.php.orig 2019-10-14 23:03:10.624511675 +0500
+++ frontends/php/include/html.inc.php 2019-10-14 23:05:35.610755722 +0500
@@ -363,6 +363,13 @@
* the count of rows
*/
if ($lld_ruleid == 0) {
+ // latest data
+ if (!$is_template) {
+ $content_menu->addItem(
@cherts
cherts / zabbix-agent.service
Created November 6, 2019 11:36
zabbix-agent.service
[Unit]
Description=Zabbix Agent
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/etc/zabbix/zabbix_agentd.conf"
EnvironmentFile=-/etc/default/zabbix-agent
Type=forking
Restart=on-failure
@cherts
cherts / zabbix-server.service
Created November 6, 2019 11:37
zabbix-server.service
[Unit]
Description=Zabbix Server
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/etc/zabbix/zabbix_server.conf"
EnvironmentFile=-/etc/default/zabbix-server
Type=forking
Restart=on-failure
@cherts
cherts / zabbix-proxy.service
Created November 6, 2019 11:39
zabbix-proxy.service
[Unit]
Description=Zabbix Proxy
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/etc/zabbix/zabbix_proxy.conf"
EnvironmentFile=-/etc/default/zabbix-proxy
Type=forking
Restart=on-failure