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 / 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 / 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 / .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 / 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 / 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 / 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 / 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 / install_synology_drive_on_fedora.sh
Created September 29, 2019 20:19 — forked from JochemKuijpers/install_synology_drive_on_fedora.sh
Installs Synology Drive on Fedora 29 (from the .deb package). Use at own risk.
#!/usr/bin/env bash
if [[ $UID != 0 ]];
then
echo "Please run this script with sudo or as root:"
echo
echo "sudo $0 $*"
exit 1 || return 1
fi
@xnohat
xnohat / ntfs-file-system-increase-speed-performance.com
Created March 10, 2019 20:21 — forked from p3x-robot/ntfs-file-system-increase-speed-performance.com
🚄 This is a simple utility to increase the NTFS performance by turning off some NTFS features that are not so used by now (or not so important).
rem execute as an Administrator
rem based on http://www.windowsdevcenter.com/pub/a/windows/2005/02/08/NTFS_Hacks.html
ram based on https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc938961(v=technet.10)
rem http://archive.oreilly.com/cs/user/view/cs_msg/95219 (some installers need 8dot3 filenames)
rem disable 8dot3 filenames
ram Warning: Some applications such as incremental backup utilities rely on this update information and do not function correctly without it.
fsutil behavior set disable8dot3 1
@xnohat
xnohat / dedupe.ps1
Created September 30, 2018 12:28
Removing duplicate entries in NuGet packages.config
# Paste this entire script into NuGet Package Manager Console with an open solution in Visual Studio.
# This script will locate projects with duplicate dependencies in packages.config and remove them.
Function Get-Duplicate {
param([Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]$array, [switch]$count)
begin {
$hash = @{}
}
process {
$array | %{ $hash[$_] = $hash[$_] + 1 }