Skip to content

Instantly share code, notes, and snippets.

View hoangdh's full-sized avatar
🏠
Working from home

Dao Huy Hoang hoangdh

🏠
Working from home
View GitHub Profile
@hoangdh
hoangdh / instaloader.md
Last active March 12, 2025 08:07
Download all videos from Instagram

Install instaloader

pip3 install --user instaloader

Download all video from masukiye_bungalov channel

instaloader --post-filter="is_video" --no-video-thumbnails --no-metadata-json --filename-pattern={date_utc:%Y}/{shortcode} masukiye_bungalov
@hoangdh
hoangdh / install-mongodb-6.0.sh
Created January 25, 2024 09:59
Script to install mongodb on Ubuntu 22.04
echo "vm.zone_reclaim_mode=0
vm.swappiness=1
vm.max_map_count=102400" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf
apt-get install gnupg curl -y
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb -P /tmp
dpkg -i /tmp/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb && rm /tmp/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
@hoangdh
hoangdh / add-swap.sh
Last active October 2, 2023 13:53
Add swapfile on Linux
#!/bin/bash
fallocate -l 1G /swapfile;
chmod 600 /swapfile; mkswap /swapfile;
cp /etc/fstab /etc/fstab.bk;
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab;
swapon -a;
sysctl vm.swappiness=15;
sysctl vm.vfs_cache_pressure=50

When run apt update,

root@hadoop123:~# apt-get update
Get:5 https://repo.saltproject.io/py3/ubuntu/20.04/amd64/archive/3005 focal InRelease [2125 B]
Err:5 https://repo.saltproject.io/py3/ubuntu/20.04/amd64/archive/3005 focal InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E08A149DE57BFBE
Reading package lists... Done
W: GPG error: https://repo.saltproject.io/py3/ubuntu/20.04/amd64/archive/3005 focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E08A149DE57BFBE
E: The repository 'https://repo.saltproject.io/py3/ubuntu/20.04/amd64/archive/3005 focal InRelease' is not signed.
@hoangdh
hoangdh / touchpad
Created August 10, 2022 14:30
Switch Enable/Disable touchpad on Ubuntu
#!/bin/bash
if [ "$1" == "on" ]
then
synclient TouchpadOff=0
echo "$(date '+%F %T') - INFO: Touchpad is enabled."
elif [ "$1" == "off" ]
then
echo "$(date '+%F %T') - INFO: Touchpad is disabled."
synclient TouchpadOff=1
@hoangdh
hoangdh / cloudera_6.3.2_log4j-rce.md
Last active June 26, 2022 02:37
Fixed Log4j RCE Dec 10 2021 for Hadoop Cluster using CDH
@hoangdh
hoangdh / README.MD
Created August 19, 2021 17:42
Webhook example using Python Flask

Webhook Example

#!/usr/bin/python3
# -*- coding: utf-8 -*-

from flask import Flask, request

app = Flask(__name__)
@hoangdh
hoangdh / registry-schema.md
Last active August 15, 2020 17:04
Setup Hortonwork Registry Schema using systemd
Mon Jun 8 21:53:10 +07 2020 Starting master on sysadmin-hbase-compact-test-50-61
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63983
max locked memory (kbytes, -l) 16384
max memory size (kbytes, -m) unlimited
open files (-n) 32000
pipe size (512 bytes, -p) 8
@hoangdh
hoangdh / compile-atop-from-source-on-ubuntu.md
Last active December 3, 2021 08:52
How to compile atop from source code on Ubuntu

How to compile atop from source code on Ubuntu

1. Download atop source code from homepage

https://www.atoptool.nl/downloadatop.php

OR using wget command