Skip to content

Instantly share code, notes, and snippets.

View ngdanghau's full-sized avatar

Nguyen Dang Hau ngdanghau

View GitHub Profile
<?php
//v1.2 by cloudsabo.net
// Tùy ý edit lại cho gọn, nhưng Output phải đúng cấu trúc để Extension đọc được nha :D
error_reporting(1);
$action = $_GET['action'];
$response = array();
$hostname = "{imap-mail.outlook.com:993/ssl}Inbox";
$email = $_GET['email'];
$password = $_GET['password'];
if (preg_match("/hotmail/i", $email) or preg_match("/outlook/i", $email)) {
@ngdanghau
ngdanghau / post-mortem.md
Created May 8, 2021 00:42 — forked from joewiz/post-mortem.md
Recovery from nginx "Too many open files" error on Amazon AWS Linux

On Tue Oct 27, 2015, history.state.gov began buckling under load, intermittently issuing 500 errors. Nginx's error log was sprinkled with the following errors:

2015/10/27 21:48:36 [crit] 2475#0: accept4() failed (24: Too many open files)

2015/10/27 21:48:36 [alert] 2475#0: *7163915 socket() failed (24: Too many open files) while connecting to upstream...

An article at http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ provided directions that mostly worked. Below are the steps we followed. The steps that diverged from the article's directions are marked with an *.

  1. * Instead of using su to run ulimit on the nginx account, use ps aux | grep nginx to locate nginx's process IDs. Then query each process's file handle limits using cat /proc/pid/limits (where pid is the process id retrieved from ps). (Note: sudo may be necessary on your system for the cat command here, depending on your system.)
  2. Added fs.file-max = 70000 to /etc/sysctl.conf
@ngdanghau
ngdanghau / nginxproxy.md
Created December 18, 2020 12:53 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@ngdanghau
ngdanghau / subtitle-extract.md
Created May 26, 2019 13:17 — forked from pavelbinar/extract-subtitles-from-mkv.md
Extract subtitles from *.mkv files on Mac OS X

Extract Subtitles From .mkv

This instructions whall work on any system (Mac OS X, Linux) supporting installation of mkvtoolnix

Install mkvtoolnix

If you don't have Homebrew installed, do it first, the continue with following command:

brew install mkvtoolnix
var arr = ['1926763480968747', '1686592028103424', '998756293613026']; // list groups
var userid = '100012432014659'; // userid that you want add admin or moderator
arr.forEach(function(group) {
var xhttp = new XMLHttpRequest();
var fb_dtsg = document.getElementsByName("fb_dtsg")[0].value;
xhttp.open("POST", "https://www.facebook.com/ajax/groups/admins_post.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
//xhttp.send("fb_dtsg=" + fb_dtsg + "&group_id=" + group + "&user_id=" + userid + "&operation=confirm_add_moderator&source=profile_browser&make_moderatorn=1"); // moderator
xhttp.send("fb_dtsg=" + fb_dtsg + "&group_id=" + group + "&user_id=" + userid + "&operation=confirm_add_admin&source=profile_browser&make_admin=1"); //admin
});
var arr = ['2144755982218012', '2016807695312861'];
var xhttp = new XMLHttpRequest();
var fb_dtsg = document.getElementsByName("fb_dtsg")[0].value;
arr.forEach(function(gid) {
xhttp.open("POST", "https://www.facebook.com/ajax/groups/information/edit.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("fb_dtsg=" + fb_dtsg + "&admin_post_approval=1&group_id=" + gid + "&admin_post_approval_value=1&stories_post_permissions=GROUP_MEMBERS&admin_story_post_approval=1");
console.log(gid + " => Successfully");
});
var arr = ['2144755982218012'];
var privacy = 'open'; // closed // secret
var fb_dtsg = document.getElementsByName("fb_dtsg")[0].value;
arr.forEach(function(gid) {
xhttp.open("POST", "https://www.facebook.com/ajax/groups/information/edit.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("fb_dtsg=" + fb_dtsg + "&privacy=" + privacy + "&group_id=" + gid + "&source=edit_privacy&confirm=confirm&confirmed=1");
console.log(gid + " => Successfully");
});
var arr = ['2054378391452782'];
var xhttp = new XMLHttpRequest();
var fb_dtsg = document.getElementsByName("fb_dtsg")[0].value;
arr.forEach(function(gid) {
xhttp.open("POST", "https://www.facebook.com/ajax/groups/membership/leave.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("group_id=" + gid + "&ref=group_mall&dpr=1&fb_dtsg=" + fb_dtsg + "&prevent_readd=on&confirmed=1");
console.log(gid + " => Successfully");
});
<?php
$salt = '39e1e949fc21def2f2671b9dbd9712de';
$str_overral = $salt;
// bắt đầu xóa dấu cách trong string
$str_overral = preg_replace('/\s+/', '', $str_overral);
$str_res='';
for ($i=0; $i < strlen($str_overral); $i++) {
$l = $str_overral[$i];
$d = ord($str_overral[$i]); //lấy mã ASCII của ký tự
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=https://www.facebook.com/anh.nhim.50" id="url">
<title>Redirecting to https://www.facebook.com/anh.nhim.50</title>
<link rel="shortcut icon" href="/favicon.png">
<style>
html{margin:0;padding:0;width:100%;height:100%;}body{margin:0;padding:0;width:100%;height:100%;color:#B0BEC5;display:table;font-weight:100;font-family:Menlo,Monaco,Consolas,"Courier New",monospace}.container{text-align:center;display:table-cell;vertical-align:middle}.content{text-align:center;font-size:18px;display:inline-block}.content a{color:#5bc0de;text-decoration:none}
</style>