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
| set showmode | |
| set laststatus=2 | |
| set statusline+=%F | |
| map ^H :!more ~/.vi_help^M | |
| map #2 :set number^M | |
| map #3 :set nonumber^M | |
| map #4 :set autoindent^M | |
| map #5 :set noautoindent^M | |
| map #6 :set list^M | |
| map #7 :set nolist^M |
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/sh | |
| echo "Make sure update_note.txt is ready." | |
| echo | |
| ./wait_confirm.sh | |
| datef=`date '+%Y%m%d.%H%M'` | |
| echo "date is: " $datef | |
| backup_home=/mnt/whale/ubuntu16.04.2.of.1_archive/$datef |
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/sh | |
| # check and list the top folders of a give tar file | |
| # Or simply use archivemount | |
| # https://linuxaria.com/howto/how-to-mounts-an-archive-for-access-as-a-file-system | |
| # tar_archive_path as /path/to/archive.tar.gz | |
| tar_archive_path=$1 | |
| mkdir -p /tmp/tartest |
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
| compress: | |
| tar -zcvf tar-archive-name.tar.gz source/folder/name | |
| decompress: | |
| tar -zxvf tar-archive-name.tar.gz | |
| tar -zxvf tar-archive-name.tar.gz -C /tmp | |
| mkdir -p /tmp/tartest && rm -r /tmp/tartest/* && tar -zxvf tar-archive-name.tar.gz -C /tmp/tartest && ls -a /tmp/tartest | |
| Both tar -c and tar -x don't affect the user permissions of the folders in the tar.gz file | |
| ============ |
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/sh | |
| # The number of partition tables could be varied and uncertain. | |
| # So is the length of backup file. | |
| # Only works in limited situations | |
| # Won't work if any new partition is added to the partition table later | |
| # Require sudo privilege | |
| # Use the code only after you know what you're doing. Use at your own risk. | |
| # Change the variables in the script if necessary |
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/sh | |
| # The number of partitions in the partition table could be varied and uncertain. | |
| # So is the length of backup file. | |
| # Only works in limited situations | |
| # Won't work if any new partition table is added to the partition table later | |
| # Require sudo privilege | |
| # Use the code only after you know what you're doing. Use at your own risk. | |
| # Change the variables in the script if necessary |
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/sh | |
| # add files to rcN.d folders for a given name of existed init file | |
| # ./rcgroup_add_files.sh init_file_name | |
| ln -s /etc/init.d/"$1" /etc/rc0.d/K20"$1" | |
| ln -s /etc/init.d/"$1" /etc/rc1.d/K20"$1" | |
| ln -s /etc/init.d/"$1" /etc/rc2.d/S20"$1" | |
| ln -s /etc/init.d/"$1" /etc/rc3.d/S20"$1" | |
| ln -s /etc/init.d/"$1" /etc/rc4.d/S20"$1" |
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/sh | |
| ### BEGIN INIT INFO | |
| # Provides: $app_name | |
| # Required-Start: $network $local_fs $remote_fs | |
| # Required-Stop: $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: lightweight | |
| # Description: app is a lightweight | |
| # for embedded devices and low end boxes. |
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/sh | |
| # word expansion {..,..} works in bash but not sh shell, use for loop instead. | |
| #ln -s /etc/init.d/initfile-local /etc/rc{0,1}.d/K20initfile-local | |
| target=/etc/init.d/initfile-local | |
| #The sh shell doesn't support word expanson well. | |
| dirs="rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d" | |
| for dir in $dirs | |
| do echo $dir |