Skip to content

Instantly share code, notes, and snippets.

View changchichung's full-sized avatar

Eric Chang changchichung

  • Taiwan
View GitHub Profile
@changchichung
changchichung / add bat command to ubuntu.md
Created July 10, 2023 07:21
add bat command to ubuntu

you will not be able to run command bat after you install bat package from apt. were is how to fix it.

using update-alternative command

2023-07-10 11:06:50 [chchang@us ~ ]$ sudo update-alternatives --install
update-alternatives: --install needs <link> <name> <path> <priority>

Use 'update-alternatives --help' for program usage information.
2023-07-10 11:07:39 [chchang@us ~ ]$ 
@changchichung
changchichung / Untitled.md
Last active July 10, 2023 07:15
replace last part of ip address to 0/24 to represent a Class C network

command

 | tr -d " " | sed 's/[0-9]*$/0\/24/'

result

echo "192.168.1.1" | tr -d " " | sed 's/[0-9]*$/0\/24/'
192.168.1.0/24
@changchichung
changchichung / take_database_snapshot.sh
Last active January 16, 2023 07:23 — forked from bahodge/take_database_snapshot.sh
Take a snapshot of your postgres database
#!/usr/bin/bash
# This script will take a snapshot of the database
# It will then gzip it
# It will save it in the 'storage' directory
# it will delete any old db snapshots > 7 days.
echo "===== Starting Snapshot ===="
# add two vars
database_name='test_db'
database_user='test_user'
from tcboeira
```
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string pt_BR
# Set language, country and locale.
d-i debian-installer/language string pt_BR
d-i debian-installer/country string BR
d-i debian-installer/locale string pt_BR.UTF-8
@changchichung
changchichung / Welcome file.md
Last active November 30, 2020 03:39
a new test



title: “first markdown note from stackedit”

群襬搖搖 笑知小鳥