Skip to content

Instantly share code, notes, and snippets.

View anhvietcr's full-sized avatar
💭
Well, I'm feeling

Anhvietcr anhvietcr

💭
Well, I'm feeling
View GitHub Profile
@anhvietcr
anhvietcr / mysql-transfer-remote.md
Last active April 14, 2022 02:08
Dump and send file, folders 2 serve in forge
ssh-keygen -R "hostname"

create user 'replicator'@'%' identified by 'password'; 
grant replication slave on *.* to 'replicator'@'%'; 
SHOW MASTER STATUS; 
mysqldump -u forge -p db_name > db_name.sql

# Máy source tạo ra ssh key để máy dist (nhận db) add ssh public key vào
cd ~/.ssh
@anhvietcr
anhvietcr / EBS_Volume_Increase.MD
Last active December 16, 2021 15:14
Increase the size of EBS volume in your EC2 instance
  1. SSH into you instance.
  2. Type df -h to check volume size; You will still have 30GB of volume size.
  3. Type lsblk ; Your increased volume will be shown just above your current volume, e.g. xvda1 is your current volume with 30GB size and xvda with 40GB size.
  4. Extend the partition by typing sudo growpart /dev/xvda 1 ; Note that dev/xvda is the partition name and 1 is the partition number.
  5. Extend the volume by typing sudo resize2fs /dev/xvda1 .
  6. Type df -h to check volume size; It will show 40GB of volume size.
@anhvietcr
anhvietcr / see_older facebook message.js
Created August 5, 2020 08:09
see_older facebook message
setInterval(function () { document.getElementById('see_older') .getElementsByClassName('content')[0].click(); }, 500);
@anhvietcr
anhvietcr / login.json
Last active February 17, 2020 09:17
stoo.vn api
body
{
"email": "ad2@gmail.com",
"password": "1"
}
response
{
"Notification": {
"User": {
@anhvietcr
anhvietcr / node-nginx-certbox.md
Last active December 24, 2019 08:18
nodejs + nginx + certbot
  • Installing Node.js 10.x
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
  • Install PM2
@anhvietcr
anhvietcr / undo git reset --hard
Created October 27, 2019 10:35
undo git reset --hard
git fsck --lost-found
=======
for blob in $(git fsck --lost-found | awk '$2 == "blob" { print $3 }'); do git cat-file -p $blob > $blob.txt; done
========
@anhvietcr
anhvietcr / console.js
Created October 18, 2019 03:22
Show file size all file in github repos
javascript:(function(){function u(n){var r=document.querySelector('table.files a[title="'+n.name+'"]'),i=r.closest("tr").querySelector("td.age"),t=document.createElement("td");n.type==="file"&&(t.textContent=(n.size/1024).toLocaleString("en-US",{minimumFractionDigits:1,maximumFractionDigits:1})+" KB",t.style.textAlign="right");i.parentNode.insertBefore(t,i)}var n=window.location.pathname.split("/"),t,r,i;n[0].length===0&&(n=n.slice(1));t=["https://api.github.com/repos",n[0],n[1],"contents"];n.length>2&&(n.length>4&&(t=t.concat(n.slice(4))),r=n[3]);i=t.join("/");r&&(i+="?ref="+r);console.log(i);fetch(i).then(n=>n.json()).then(n=>{Array.isArray(n)&&n.forEach(u)})})()
@anhvietcr
anhvietcr / SSH remote server.md
Created October 12, 2019 14:51
SSH remote server

ssh-keygen -t rsa -b 2048

ssh-copy-id id@server

-> password

check

.ssh/authorized_keys

@anhvietcr
anhvietcr / debugBorderDevtool.js
Created August 18, 2019 02:46
The Command Line API for Fun and Profit
[].forEach.call($$("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
@anhvietcr
anhvietcr / Check-API-CSharp.cs
Created August 6, 2019 12:45
Check api sandbox enviroment
using System;
using System.IO;
using System.Json;
using System.Net;
using System.Windows.Forms;
namespace ViaInstagram.Core
{
static class Program
{