Skip to content

Instantly share code, notes, and snippets.

View daubac402's full-sized avatar
🇻🇳
🎄

NguyenTheAnh daubac402

🇻🇳
🎄
View GitHub Profile
@daubac402
daubac402 / Aircrack-ng Commands (MAC OS)
Last active September 5, 2018 03:01 — forked from victorreyesh/Aircrack Commands
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//Install Macports or brew
//Install aircrack-ng
sudo port install aircrack-ng
//or
brew install aircrack-ng
//Install the latest Xcode, with the Command Line Tools
//Create the following symlink
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
@daubac402
daubac402 / List all crontabs for all users on UNIX systems
Last active July 19, 2021 01:08 — forked from jvsidler/gist:4610255
List all crontabs for all users on UNIX systems
# Must be root
# Credit: http://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users
$ for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
@daubac402
daubac402 / gist:0e0f8a4296858dac9b775ba3cd390310
Last active September 10, 2018 08:33
Install & config postfix on CentOS
Step 1 - Install
# yum remove sendmail
# yum install postfix
Make postfix as default MTA for your system using the following command
# alternatives --set mta /usr/sbin/postfix
If above command not work and you get the output as “/usr/sbin/postfix has not been configured as an alternative for mta“. Use below command to do the same else skip it
# alternatives --set mta /usr/sbin/sendmail.postfix
@daubac402
daubac402 / Force redirect from http to https (editing your .htaccess OR your .conf)
Last active August 10, 2021 06:41
Force redirect from http to https (editing your .htaccess OR your .conf)
# edit .htaccess way
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# edit .conf way (add into <VirtualHost *:80)
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]
@daubac402
daubac402 / Optimize compression - caching for Website (.htaccess)
Last active September 27, 2018 07:33
Optimize compression - caching for Website (.htaccess)
<IfModule mod_deflate.c>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
## This will be fixed by
find /var/www -type d -exec chmod 755 {} \;
find /var/www -type f -exec chmod 644 {} \;
@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.
@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
# 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 / 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