Skip to content

Instantly share code, notes, and snippets.

View dmitvitalii's full-sized avatar
⌨️
THE MORE YOU LESS THE BETTER YOU HEAD

Vitalii Dmitriev dmitvitalii

⌨️
THE MORE YOU LESS THE BETTER YOU HEAD
View GitHub Profile
@tsrivishnu
tsrivishnu / docker-increase-inotify-max-user-watches.md
Last active April 8, 2024 12:15
Increase inotify watchers in Docker images during build

Increasing fs.inotify.max_user_watches for Docker images

TL;DR You can't set those for an image during build time becasue Docker takes the sysctl configuration from the Host. So, set the config on your host machine.

As in this link, to increase the maximum watchers, we need set fs.inotify.max_user_watches to a higher number in /etc/sysctl.conf.

@mleinart
mleinart / GobiNet-linux_3_19.diff
Last active March 13, 2020 21:49
Patch to GobiNet driver to support linux kernel >= 3.19
This is a patch to the GobiNet driver provided by Netgear
(http://www.downloads.netgear.com/files/aircard/Linux-Support-S2.13N2.25.zip) to support Kernel versions 3.19 and up
which deprecated the struct file->f_dentry api (https://lwn.net/Articles/206758/) as well as to support kernel versions 4.7
and above which removed struct net_device->trans_start
You need this patch if you see either of these errors while compiling:
/usr/src/GobiNet/GobiUSBNet.c: In function ‘GobiUSBNetStartXmit’:
/usr/src/GobiNet/GobiUSBNet.c:1201:8: error: ‘struct net_device’ has no member named ‘trans_start’; did you mean ‘mem_start’?
pNet->trans_start = jiffies;
@nigelbabu
nigelbabu / export.sql
Last active November 20, 2018 08:19
Migrating from H2 into PostgreSQL
CALL CSVWRITE('/tmp//migrate/ACCOUNTS', 'SELECT * FROM ACCOUNTS');
CALL CSVWRITE('/tmp//migrate/ACCOUNT_DIFF_PREFERENCES', 'SELECT * FROM ACCOUNT_DIFF_PREFERENCES');
CALL CSVWRITE('/tmp//migrate/ACCOUNT_EXTERNAL_IDS', 'SELECT * FROM ACCOUNT_EXTERNAL_IDS');
CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUPS', 'SELECT * FROM ACCOUNT_GROUPS');
CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_BY_ID', 'SELECT * FROM ACCOUNT_GROUP_BY_ID');
CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_BY_ID_AUD', 'SELECT * FROM ACCOUNT_GROUP_BY_ID_AUD');
CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_MEMBERS', 'SELECT * FROM ACCOUNT_GROUP_MEMBERS');
CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_MEMBERS_AUDIT', 'SELECT * FROM ACCOUNT_GROUP_MEMBERS_AUDIT');
CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_NAMES', 'SELECT * FROM ACCOUNT_GROUP_NAMES');
CALL CSVWRITE('/tmp//migrate/ACCOUNT_PATCH_REVIEWS', 'SELECT * FROM ACCOUNT_PATCH_REVIEWS');
@bgusach
bgusach / multireplace.py
Last active February 16, 2024 02:52
Python string multireplacement
def multireplace(string, replacements, ignore_case=False):
"""
Given a string and a replacement map, it returns the replaced string.
:param str string: string to execute replacements on
:param dict replacements: replacement dictionary {value to find: value to replace}
:param bool ignore_case: whether the match should be case insensitive
:rtype: str
"""
@swordfeng
swordfeng / chn_fonts.reg
Last active February 21, 2024 19:01
Chinese font settings in wine
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
"Arial"="wqy-microhei.ttc"
"Arial Black"="wqy-microhei.ttc"
"Arial CE,238"="wqy-microhei.ttc"
"Arial CYR,204"="wqy-microhei.ttc"
"Arial Greek,161"="wqy-microhei.ttc"
"Arial TUR,162"="wqy-microhei.ttc"
"Courier New"="wqy-microhei.ttc"
@pcholakov
pcholakov / gerrit.conf
Created October 30, 2014 11:48
Gerrit ActiveDirectory LDAP_BIND authentication example
# To log in, use "user@example.com" and NT password in the Gerrit login form. To confirm the pattern for your directory, test with:
# ldapsearch -h adldap -s sub -s sub -b 'dc=example,dc=com' "(&(objectClass=person)(userPrincipalName=user@example.com))"
[auth]
type = LDAP_BIND
[ldap]
server = ldap://adldap
accountBase = DC=example,DC=com
accountPattern = (&(objectClass=person)(userPrincipalName=${username}))
#accountPattern = (&(objectClass=person)(sAMAccountName=${username}))
@imkevinxu
imkevinxu / .gitconfig
Created November 5, 2012 09:42
`git random` alias that will commit a random commit message from http://whatthecommit.com/
[alias]
random = !"git add -A; git commit -am \"$(echo $(curl -s http://whatthecommit.com/index.txt)\" (http://whatthecommit.com)\")\"; git pull --rebase; git push"