Skip to content

Instantly share code, notes, and snippets.

View canhnm's full-sized avatar

canhnm canhnm

View GitHub Profile
@canhnm
canhnm / gist:fd8a9023f3555c2a35550ba0f0af033f
Created June 28, 2019 02:24
React Native - Clean all cache to rebuild signed APK release
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/metro-_ && rm -rf \$TMPDIR/haste-_ && npm cache clean --force && npm cache verify && rm -rf android/build && rm -rf node_modules/ && npm i && rm android/app/src/main/assets/index.android.bundle && react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew clean && ENVFILE=.env ./gradlew assembleRelease
@canhnm
canhnm / background.js
Created March 29, 2018 07:29 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@canhnm
canhnm / sysctl.conf
Created August 10, 2017 02:57 — forked from kgriffs/sysctl.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# Protection from SYN flood attack.
net.ipv4.tcp_syncookies = 1
@canhnm
canhnm / ocp.php
Created August 16, 2014 03:31 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
@canhnm
canhnm / smtpcheck.py
Created December 26, 2011 12:37 — forked from blinks/smtpcheck.py
Check if an email address exists without sending an email. Technique from: http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/
#!/usr/bin/env python
"""
Check that a particular email address exists.
Adam Blinkinsop <blinks@acm.org>
WARNING:
Checking email addresses in this way is not recommended, and will lead to
your site being listed in RBLs as a source of abusive traffic. Mail server
admins do like it when they get connections that don't result in email being
sent, because spammers often use this technique to verify email addresses.