Skip to content

Instantly share code, notes, and snippets.

View daubac402's full-sized avatar
🇻🇳
🎄

NguyenTheAnh daubac402

🇻🇳
🎄
View GitHub Profile
@daubac402
daubac402 / .htaccess - Increase Performance on Apache server
Last active April 23, 2019 09:00
.htaccess - Increase Performance on Apache server
# TN START GZIP COMPRESSION
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
@daubac402
daubac402 / Can not Add user to vsftpd? Have a look at pam_service
Last active April 13, 2020 04:44
Can not Add user to vsftpd? Have a look at pam_service
1) Check in /etc/vsftpd/vsftpd.conf
pam_service_name=???
2) Check pam config in /etc/pam.d/???
Eg:
auth required /usr/lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
account required /usr/lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
3) Check user config to set home directory at /etc/vsftpd/vsftpd.conf
user_config_dir=/etc/vsftpd/vsftpd_user_conf/
@daubac402
daubac402 / Apachectl - check config and restart
Created April 10, 2019 05:25
Apachectl - check config and restart
1) Config check
apachectl -t
2) Restart apache
apachectl graceful
OR
apachectl -k graceful
@daubac402
daubac402 / Avoid IE Compatibility Mode
Created April 10, 2019 05:24
Avoid IE Compatibility Mode
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">
@daubac402
daubac402 / MySQL - Setup remotely connect
Created April 10, 2019 05:23
MySQL - Setup remotely connect
CREATE USER 'new_user'@'%' IDENTIFIED BY 'new_password';
GRANT ALL PRIVILEGES ON your_database.* TO new_user@'%' IDENTIFIED BY 'new_password';
@daubac402
daubac402 / Prepare files for sumitting to SSL CA (https)
Created April 10, 2019 05:21
Prepare files for sumitting to SSL CA (https)
1) Create 2048bit key
openssl genrsa -out file_name.key 2048
2) Create CSR
openssl req -new -key file_name.key -out file_name.csr
@daubac402
daubac402 / Convert .cer > .crt
Last active November 21, 2019 06:36
Convert .cer > .crt
openssl x509 -inform DER -in certificate.cer -out certificate.crt
# if error, try this:
openssl x509 -inform PEM -in certificate.cer -out certificate.crt
# With nginx SSL setting, it only uses .key and .pem
# build this .pem file with .crt and then append .cer (SSL chain) into it
cat your_file.crt your_file.cer > your_file.pem
# CentOS 6
#############################
# Accept port 60006
iptables -I INPUT -p tcp -m tcp --dport 60006 -j ACCEPT
# Save current rules
service iptables save
# Clear input chain
sudo iptables -F INPUT
@daubac402
daubac402 / Install Teamviewer, Start, Get ClientID and password on the Remote Mac machine via SSH - commandline.md
Last active September 24, 2023 03:29
Install Teamviewer, Start, Get ClientID and password on the Remote Mac machine via SSH - commandline

Requirement

  • Homebrew on the Remote Mac (if not, just install it via SSH)

Steps

# ssh to the remote Mac machine, then:
brew install caskroom/cask/brew-cask
brew cask install teamviewer
@daubac402
daubac402 / Unable to find any non-expired Ad Hoc or Enterprise Ad Hoc provisioning profiles that match the app id
Last active March 27, 2019 02:19
Unable to find any non-expired Ad Hoc or Enterprise Ad Hoc provisioning profiles that match the app id
Tip, if you’e using @appcelerator #Titanium and getting:
“Unable to find any non-expired Ad Hoc or Enterprise Ad Hoc provisioning profiles that match the app id”
Check your ~/.titanium/config.json and ensure you haven’t set a default cert in the iOS section.