Skip to content

Instantly share code, notes, and snippets.

Ha Nguyen hanguyen221

Block or report user

Report or block hanguyen221

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hanguyen221
hanguyen221 / backup_mongo.sh
Created Sep 13, 2018
To back up & restore from backup for mongodb.
View backup_mongo.sh
#! /bin/sh
# replace with address of folder that contains backups
DIR=/Users/nguyen.thanh.ha/Desktop/backupmongo
# remove all backups older than 30 days
find $DIR -mtime +30 -exec rm -rf {} \;
# create new backup for today
mongodump -h <host>:<port> --db <db name> -u <user name> -p <password> --out $DIR/`date +"%Y-%m-%d-%H%M%S"`
@hanguyen221
hanguyen221 / CheckCommentFb.html
Last active May 8, 2018
Use to check a number is commented or not in a Facebook giveaway post
View CheckCommentFb.html
<!-- Khi dùng thay APP_ID, OBJECT_ID, ACCESS_TOKEN và NUMBER_TO_CHECK -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
@hanguyen221
hanguyen221 / bot.py
Last active Sep 6, 2017
Chat bot for facebook messenger
View bot.py
# -*- coding: utf-8 -*-
import sys
import os.path
sys.path.append('/usr/local/lib/python3.6/site-packages')
import fbchat
from fbchat import log, Client # Nạp thư viện của fbchat
from fbchat.models import TypingStatus
import re
You can’t perform that action at this time.