Skip to content

Instantly share code, notes, and snippets.

View mvh97hg's full-sized avatar

Hungmv mvh97hg

  • 03:06 (UTC +07:00)
View GitHub Profile
@mvh97hg
mvh97hg / fix yum update centos7
Last active July 10, 2024 04:20
fix centos 7 yum update error
#!/bin/bash
# repo centos 7
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo
echo "sslverify=false" >> /etc/yum.conf
@mvh97hg
mvh97hg / asterisk.sh
Last active October 28, 2024 07:20 — forked from kolosek/asterisk.sh
Install Asterisk 20 LTS on Ubuntu 20.04 & Debian
#Update system & reboot
sudo apt update && sudo apt -y upgrade
#sudo reboot
#Install Asterisk 20 LTS dependencies
sudo apt-get install curl wget libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential sox libjansson-dev libxml2-dev uuid-dev sngrep libdbi-perl dos2unix libdbd-mysql-perl -y
cd ~
sudo curl -O http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz
@mvh97hg
mvh97hg / README.md
Last active November 18, 2023 17:24 — forked from programmerq/README.md
Teleport Auto Updater

Simple systemd service that checks /etc/teleport.yaml for the proxy URL, checks the teleport version of the proxy, and attempts to upgrade and apt-mark hold the teleport package. timer unit kicks it off once a day.

to install:

dependencies include curl and yq

apt-get update && apt-get -y install curl
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq && chmod +x /usr/local/bin/yq
@mvh97hg
mvh97hg / postgres-cheatsheet.md
Created November 13, 2023 08:18 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)