This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s" | |
| git filter-branch --tree-filter 'rm -f ps1.zip' HEAD | |
| OR | |
| $ git filter-branch --index filter 'git rm --cached --ignore-unmatched blob.txt' HEAD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Connect a Raspberry Pi to LTE using MC7700 Mini PCI Modem with adapter to USB-C | |
| sudo qmicli -d /dev/cdc-wdm0 -p --wds-stop-network | |
| sudo cat /sys/class/net/wwan0/qmi/raw_ip | |
| sudo ip link set dev wwan0 down | |
| # Enable OS Raw IP Mode setting (not persistent) | |
| sudo su -c "echo Y > /sys/class/net/wwan0/qmi/raw_ip" | |
| sudo qmicli -d /dev/cdc-wdm0 -p --device-open-net="net-raw-ip|net-no-qos-header" --wds-start-network="ip-type=6" --client-no-release-cid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| crontab -e | |
| cat << EOF > /var/spool/cron/crontabs/username | |
| @reboot /home/username/services/rtc | |
| * * * * * /home/username/services/updata | |
| * * * * * ~/services/updata2 | |
| EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo dd if=/dev/zero of=/swapfile bs=1024 count=4096000 | |
| sudo chmod 600 /swapfile | |
| sudo mkswap /swapfile | |
| sudo swapon /swapfile | |
| echo '/swapfile swap swap defaults 0 0' >> /etc/fstab | |
| sudo swapon --show | |
| sudo free -h | |
| sudo sysctl vm.swappiness=50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run --restart=always --name phpmyadmin -d --link mysql:db -p 81:80 phpmyadmin/phpmyadmin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run --restart=always --name=mysql -e MYSQL_ROOT_PASSWORD=123456789 -e MYSQL_DATABASE=database_name -p 3306:3306 -d mysql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apt-get update && \ | |
| apt-get install -yq tzdata && \ | |
| ln -fs /usr/share/zoneinfo/Asia/Bangkok /etc/localtime && \ | |
| dpkg-reconfigure -f noninteractive tzdata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # @2021 Create by Tawatchai Insree | |
| import smbus | |
| import time | |
| import datetime | |
| import os, subprocess | |
| address = 0x68 | |
| register = 0x00 | |
| #sec min hour week day month year |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The use of the I2C DS3231/3232 from Armbian SBC has a few quirks, most tutorials on the internet works but only if you have internet connection. | |
| In cuba we can sometimes use Armbian on devices that are not internet connected, so most tutorial fails and after a power failure or reboot you get a non working system because some apps/soft warns and fail with a "date in the future" message. | |
| I have crafted a way to use it as a real systemd service (yes, it's a legacy service...) | |
| Create a file named: rtc_ds1307 in /etc/init.d/ you can use the command below (root privileges are required) | |
| ``` | |
| nano /etc/init.d/rtc_ds1307 |