Skip to content

Instantly share code, notes, and snippets.

View xnohat's full-sized avatar
💭
AI Developer

Hong Phuc Nguyen xnohat

💭
AI Developer
View GitHub Profile
@xnohat
xnohat / chmodmautic.sh
Created August 21, 2020 07:49
File Permission for Mautic install
cd /var/www/mautic
mkdir app/spool/
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod -R g+w app/cache/
chmod -R g+w app/logs/
chmod -R g+w app/config/
chmod -R g+w media/files/
chmod -R g+w media/images/
chmod -R g+w translations/
@xnohat
xnohat / sysctl.conf
Created October 8, 2020 13:44 — forked from hendra/sysctl.conf
Optimizing Ubuntu 16.04 Server
### IMPROVE SYSTEM MEMORY MANAGEMENT ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness=10
vm.vfs_cache_pressure = 50
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@xnohat
xnohat / beanstalkd
Last active December 15, 2020 19:10 — forked from jacobwyke/beanstalkd
Beanstalkd Monit File
#
# /etc/monit.d/beanstalkd
#
# CentOS notes:
# CentOS beanstalkd doesn't have pid file.
# in /etc/init.d/beanstalkd modify the daemonize line with a -p /var/run/beanstalk.d
# daemon /usr/sbin/daemonize -p /var/run/beanstalkd.pid -u ${BEANSTALKD_USER} $exec $options
#
@xnohat
xnohat / thumbor.conf
Created December 29, 2020 09:40 — forked from anvie/thumbor.conf
Thumbor Nginx Configuration That just works like magic
server {
server_name cdn.example.com;
listen 80;
access_log /var/log/nginx/cdn.example.com-access.log;
error_log /var/log/nginx/cdn.example.com-error.log info;
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
@xnohat
xnohat / .gitconfig
Last active January 17, 2021 09:25 — forked from shawndumas/.gitconfig
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@xnohat
xnohat / fb-id.py
Created March 14, 2021 11:18 — forked from paulschreiber/fb-id.py
Facebook User ID fetcher
#!/usr/bin/python
import requests
import re
url = 'https://www.facebook.com/zuck'
idre = re.compile('"entity_id":"([0-9]+)"')
page = requests.get(url)
print idre.findall(page.content)
@xnohat
xnohat / auto_partition_manager.sql
Last active September 9, 2021 17:19 — forked from CodMonk/CodeMonk_Part#Man.sql
MySQL Stored Procedure for Table Partitioning
DELIMITER //
DROP PROCEDURE IF EXISTS `auto_partition_manager`;
CREATE DEFINER = `root` @`localhost` PROCEDURE `auto_partition_manager`(
in partition_frequency varchar(100),
in db_schema varchar(100),
in input_table_name varchar(100),
in partition_column varchar(100)
) BEGIN -- Author - Code Monk
@xnohat
xnohat / all-vietnamese-syllables.txt
Created October 16, 2021 11:08 — forked from hieuthi/all-vietnamese-syllables.txt
All possibly existent Vietnamese syllables, created by combine all onsets with all rimes. More information can be found at: http://hieuthi.com/blog/2017/03/21/all-vietnamese-syllables.html
a
ai
am
an
ang
anh
ao
au
ay
ba
a
ai
am
an
ang
anh
ao
au
ay
ba
@xnohat
xnohat / app-search-cli
Created November 23, 2021 18:32 — forked from JasonStoltz/app-search-cli
App Search CLI
#!/usr/bin/env node
/**
* Install:
*
* Download this file and give it executuable persmissions
*
* Usage:
*
* Uploading documents