Skip to content

Instantly share code, notes, and snippets.

View huksley's full-sized avatar
🐈
Step on no pets

Ruslan Gainutdinov huksley

🐈
Step on no pets
View GitHub Profile
@huksley
huksley / winrmsetup.bat
Last active December 11, 2015 07:08
Full batch to setup WinRM in HTTPS for xebialabs/overthere
@echo off
REM Installs and configures WinRM in HTTPS mode
REM Execute this on target machine.
REM
REM xebialabs/overthere and rundeck-winrm-plugin
REM will work after this
REM
REM NOTE: You need accessible share with installation packages
REM and selfssl.exe and CertMgr.exe
REM Where to GET these?
@huksley
huksley / graylog2-install.sh
Last active December 16, 2015 15:48
Graylog2 0.11.0 fully automatic install. From basic Ubuntu 12.04 to working graylog2 web ui (http://graylog2/). Run as root> sh gistfile1.sh | tee graylog2-install.log
#!/bin/sh
# Graylog version, both server and web-ui
ver=0.11.0
# Elasticsearch version (Currently must be 0.20.4)
elasticver=0.20.4
# Set elasticheap size according to your server RAM available
elasticheap=128
# Make sure system is fully upgraded
apt-get update
@huksley
huksley / lvmhotadddisk.sh
Last active December 17, 2015 06:48
Extend LVM with new logical sdaX disk. Online, hot, without restart.
#!/bin/sh
LV=`lvs | grep -v swap | sed -re "s/^[ ]+//;s/[ ]+/ /g" | cut -d" " -f1 | tail -n+2`
VG=`lvs | grep -v swap | sed -re "s/^[ ]+//;s/[ ]+/ /g" | cut -d" " -f2 | tail -n+2`
if [ "$1" = "" ]; then
echo specify /dev/sda?
exit
fi
echo Extending /dev/mapper/$VG-$LV using $1 as source space
pvcreate $1
vgextend $VG $1
@huksley
huksley / graylog2-wipe.sh
Created May 16, 2013 10:08
Clean all data in graylog2 without deleting settings, with full restart
#!/bin/sh
service elasticsearch stop
service graylog2-server stop
killall -9 java
service apache2 stop
rm -Rf /opt/elasticsearch/data/*
# IF YOU HAVE AUTH USE THIS LINE - mongo graylog2 --eval "db.auth('graylog2', 'PASSWORD'); db.message_counts.remove();"
mongo graylog2 --eval "db.message_counts.remove();"
service elasticsearch start
service graylog2-server start
@huksley
huksley / tomcat-native-1.1.27-java6.patch
Last active December 18, 2015 03:48
Full build Tomcat Native library on Debian based system, with Java 6 compatibility.
diff -rwu tomcat-native-1.1.27-src/jni/java/org/apache/tomcat/jni/socket/AprSocketContext.java tomcat-native-1.1.27-src-java6/jni/java/org/apache/tomcat/jni/socket/AprSocketContext.java
--- tomcat-native-1.1.27-src/jni/java/org/apache/tomcat/jni/socket/AprSocketContext.java 2012-10-27 01:33:31.000000000 +0400
+++ tomcat-native-1.1.27-src-java6/jni/java/org/apache/tomcat/jni/socket/AprSocketContext.java 2013-06-06 13:04:22.535458514 +0400
@@ -118,7 +118,7 @@
/**
* Pollers.
*/
- List<AprPoller> pollers = new ArrayList<>();
+ List<AprPoller> pollers = new ArrayList<AprPoller>();
static int pollerCnt = 0;
@huksley
huksley / mksvndump.bat
Created June 18, 2013 12:29
Make incremental subversion repo dump, reading previous state from dump log and making new incremental file on each invocation. Please note, this Win32 bat file requires some tools from gnuwin32 project.
@echo off
REM Makes incremental dump, reading previous state from dump log
set REPO=%1
set LOG=%~n1.log
set DUMPBASE=%~n1
set REV=
if "%REPO%"=="" echo Usage: %0 ^<repo^> && goto exit
if not exist %LOG% echo Starting from beginning of repo && set REV=1&& goto dump
@huksley
huksley / install-mongodb.sh
Last active December 25, 2015 12:19
Install mongodb latest with auth admin:123
#!/bin/sh
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get -y install mongodb-10gen
sudo service mongodb start
echo "use admin; db.addUser({ user: 'admin', pwd: '123', roles: [ 'userAdminAnyDatabase' ] });" | mongo
sudo service mongodb stop
echo "rest = true" | sudo tee /etc/mongodb.conf
@huksley
huksley / gistsync.sh
Last active December 22, 2021 08:36
Downloads all .sh gists for user (current user if not set), into $HOME/bin folder. This script will overwrite all local changes.
#!/bin/bash
# Downloads all .sh gists for user into $HOME/bin.
GUSER=`whoami`
GUSERN=$1
if [ "$GUSERN" != "" ]; then
GUSER=$GUSERN
echo $GUSERN > $HOME/.gistuser
fi
if [ -f $HOME/.gistuser ]; then
GUSER=`cat $HOME/.gistuser`
@huksley
huksley / pubkey.sh
Last active December 27, 2015 02:49
Copy all your public keys to remote host
#!/bin/sh
# Synopsis: Copy all your public keys to remote host, enabling public key authentication on remote host
HOST=$1
if [ "$HOST" = "" ]; then
echo Usage: $0 \<hostname\>
exit 1
fi
for N in `ls $HOME/.ssh/id_*.pub`; do
ssh-copy-id -i $N $HOST
done
diff --git a/apps/core/plugins/tools/Tools.php b/apps/core/plugins/tools/Tools.php
index 400db21..b24e3bf 100644
--- a/apps/core/plugins/tools/Tools.php
+++ b/apps/core/plugins/tools/Tools.php
@@ -20,,7 +20,7 @@ namespace Kladr\Core\Plugins\Tools {
*/
public static function Normalize($str){
$str = preg_replace('/[^а-яА-Я0-9,]+/u', '', $str);
- $str = mb_strtolower($str);
+ $str = mb_strtolower($str, "UTF-8");