diff --git a/blog - 10 Minute Guide to diff and patch.md b/blog - 10 Minute Guide to diff and patch.md deleted file mode 100644 index a886077..0000000 --- a/blog - 10 Minute Guide to diff and patch.md +++ /dev/null @@ -1,84 +0,0 @@ -# 10 Minute Guide to diff and patch - -## Summary - -This is copied pretty much verbatim from [The 10-Minute Guide to Patch and Diff](http://jungels.net/articles/diff-patch-ten-minutes.html) - -I just wanted to have a local copy to refer to, so I can start making patch files instead of tediously copy/pasting changes and updates in shell scripts. - -## Procedure - -Situation one: you are trying to compile a package from source, and you discover that somebody has already done the work for you of modifying it slightly to compile on your system. They have made their work available as a "patch", but you're not sure how to make use of it. The answer is that you apply the patch to the original source code with a command line tool called, appropriately, patch. - -Situation two: you have downloaded the source code to an open source package and after an hour or so of minor edits, you manage to make it compile on your system. You would like to make your work available to other programmers, or to the authors of the package, without redistributing the entire modified package. Now you are in a situation where you need to create a patch of your own, and the tool you need is diff. - -This is a quick guide to diff and patch which will help you in these situations by describing the tools as they are most commonly used. It tells you enough to get started right away. Later, you can learn the ins and outs of diff and patch at your leisure, using the man pages. - -## Applying patches with patch - -To apply a patch to a single file, change to the directory where the file is located and call patch: - -```bash -patch < foo.patch -``` - -These instructions assume the patch is distributed in unified format, which identifies the file the patch should be applied to. If not, you can specify the file on the command line: - -```bash -patch foo.txt < bar.patch -``` - -Applying patches to entire directories (perhaps the more common case) is similar, but you have to be careful about setting a "p level". What this means is that, within patch files, the files to be patched are identified by path names which may be different now that the files are located on your computer rather than on the computer where the patch was created. The p level instructs patch to ignore parts of the path name so that it can identify the files correctly. Most often a p level of one will work, so you use: - -```bash -patch -p1 < baz.patch -``` - -You should change to the top level source directory before running this command. If a patch level of one does not correctly identify any levels to patch, inspect the patch file for file names. If you see a name like - -```bash -/users/stephen/package/src/net/http.c -``` - -and you are working in a directory that contains net/http.c, use - -```bash -patch -p5 < baz.patch -``` - -In general, count up one for each path separator (slash character) that you remove from the beginning of the path, until what's left is a path that exists in your working directory. The count you reach is the p level. - -To remove a patch, use the -R flag, ie - -```bash -patch -p5 -R < baz.patch -``` - -## Creating patches with diff - -Using diff is simple whether you are working with single files or entire source directories. To create a patch for a single file, use the form: - -```bash -diff -u original.c new.c > original.patch -``` - -To create a patch for an entire source tree, make a copy of the tree: - -```bash -cp -R original new -``` - -Make any changes required in the directory new/. Then create a patch with the following command: - -```bash -diff -rupN original/ new/ > original.patch -``` - ---- - -Reference: - -- [The 10 Minute Guide to Patch and Diff](http://jungels.net/articles/diff-patch-ten-minutes.html) - -Tags: - howto \ No newline at end of file diff --git a/blog - BASH challenges.md b/blog - BASH challenges.md deleted file mode 100644 index a59e2a8..0000000 --- a/blog - BASH challenges.md +++ /dev/null @@ -1,124 +0,0 @@ -# BASH Challenges - -These are examples of scripting challenges I was given and helped create for interviewees ---- - -1. Check for the presence of a directory and create it if it doesn't exist - - Example Solution - - ```bash - devdir="/mnt/sqlback1/LSQLSHARE01DEV" - if [[ ! -d "${devdir}" ]]; then - echo "${devdir} not found." - # Create Directory - mkdir -p "${devdir}" - fi - ``` -2. Given a threshold, determine if a given directory size is over the threshold. - - Example Solution - - ```bash - dir="/mnt/data2/backups" - threshold="100000000" # 100GB - - dirsize=$(/usr/bin/du -s ${dir} | awk '{print $1}') - - if [[ $dirsize -gt $threshold ]]; then - echo "Threshold Exceeded" - /usr/bin/du -hs "${dir}" - fi - ``` -3. Create and loop over an associative array. Ex. create an array of services and ports then print them - - Example Solution - - ```bash - # Declare service names and ports in an array - declare -A services=( [apache_http]=80 [apache_https]=443 [ssh]=22 [telnet]=23 ) - - # Iterate over services and ports - for p in "${!services[@]}"; do - echo -e "Service: ${p} \t Port ${services[$p]}" - done - ``` - - Example Output: - - ``` - Service: apache_https Port 443 - Service: telnet Port 23 - Service: ssh Port 22 - Service: apache_http Port 80 - ``` -4. Write a short script that displays the numbers 2 through 128 in brackets (even numbers only, as seen below). - - ``` - [2] - [4] - [8] - [16] - [32] - [64] - [128] - ``` - - Example Solution - - ```bash - i=1; while [ $i -lt 65 ]; do let i=$((i+i)); print "[$i]"; done``` - - ``` - - Example Output - - ``` - [2] - [4] - [8] - [16] - [32] - [64] - [128] - ``` -5. Write a script that, for each number from 1 to 100, prints a comma-delimited list of numbers in descending order from the current number to 1. Each list should be shown on a separate line as seen below. - - ``` - 1 - 2,1 - 3,2,1 - 4,3,2,1 - ... - 100,99,...,1 - ``` - - Example Solution (from 10 to save space). (OK, I cheated shaving off the trailing comma.) - - ```bash - echo "1"; for x in {2..10}; do for i in {$x..2}; do echo -n $i,; done; echo -n "1"; echo ""; done - ``` - - Best Solution: - - ```bash - for (( i=1;i<=10;i++ )); do eval printf -- '%d\\n' "{${i}..1}" | paste -sd ',' -;done - ``` - - Example Output - - ``` - 1 - 2,1 - 3,2,1 - 4,3,2,1 - 5,4,3,2,1 - 6,5,4,3,2,1 - 7,6,5,4,3,2,1 - 8,7,6,5,4,3,2,1 - 9,8,7,6,5,4,3,2,1 - 10,9,8,7,6,5,4,3,2,1 - ``` - -Tags: - howto \ No newline at end of file diff --git a/blog - CPU steal.md b/blog - CPU steal.md deleted file mode 100644 index 832e2d3..0000000 --- a/blog - CPU steal.md +++ /dev/null @@ -1,20 +0,0 @@ -# CPU Steal - -CPU steal is the percentage of time that a virtual CPU has to wait for the physical CPU while the hypervisor is fulfilling processes from another virtual CPU. In short, CPU steal occurs when a shared CPU core is delayed in processing a request. This typically occurs when there is resource contention occurring, but that is not always the case. - - -> My Linode's processes are not performing as expected. What can I do to see if CPU steal is occurring? -> If you're noticing that your Linode's performance is suffering, there is a possibility that CPU steal is occurring. The best starting point to diagnose a potential CPU steal issue is to run the following commands. - - -```shell -iostat 10 10 && for x in `seq 1 1 30`; do ps -eo state,pid,cmd | grep "^D"; echo "-"; sleep 2; done && top -bn 1 | head -15 -``` - -[explanation](https://www.linode.com/community/questions/18168/what-is-cpu-steal-and-how-does-it-affect-my-linode) - ---- - -## Notes - -* `iostat` requires the `sysstat` package be installed on the host \ No newline at end of file diff --git a/blog - KiTTy vs PuTTy.md b/blog - KiTTy vs PuTTy.md deleted file mode 100644 index 8090648..0000000 --- a/blog - KiTTy vs PuTTy.md +++ /dev/null @@ -1,293 +0,0 @@ -# KiTTY vs PuTTY - -## Summary - -Do you work on Linux machines? Do you only have a Windows machine from which to connect? Then you're probably already using PuTTY. - -Well, step aside PuTTY, there's a new terminal client in town. - -KiTTY is a fork of the original PuTTY software, with loads of new features, including a portable version that saves all of your sessions and settings into an INI file in the same folder. - -## Installation - -1. Download [KiTTY Portable](http://www.fosshub.com/KiTTY.html) -2. ??? -3. PROFIT! - -Just kidding. There are no other steps. The download is an EXE that's ready to go. Just double-click on it and enter your connection parameters (should be familiar if you've ever used PuTTY) - -## Portability - -By default, KiTTY uses the Windows registry database to save its configuration (sessions, host keys, parameters). But, it's possible to save it into a tree directories structure and to avoid writing anything into the registry. - -Create a new folder for KiTTY anywhere on your disk and move the KiTTY.exe into it. - -Create a file called `kitty.ini` in the same directory where you put KiTTY binary, and add these two lines: - -```ini -[KiTTY] -savemode=dir -``` - -If you've already used KiTTY to connect to some machines and have some profiles saved, you can copy all the existing configurations from the registry. - -You just have to run this command from a command line within the KiTTY directory - -``` -kitty.exe -convert-dir -``` - -This option will create 6 subdirectories: - -- Commands -- Folders -- Launcher -- Sessions -- Sessions\_Commands -- SshHostKeys - -containing the configuration files. - -## Colors - -The biggest reason I started using KiTTY was to get away from those horrible PuTTY colors. (Yes - you can change the colors in PuTTY - but this method is much easier) - -In your KiTTY directory, there will be a directory named: Sessions. In that folder, you will find separate files for each of your saved connections. - -Open one of them (I recommend using something like Notepad++, but plain old notepad should work too) - -Somewhere in the middle of the file, you will find several color definitions (in RBG format) - -You can modify each of these to change the color of the specific element. (But without knowing which element is which - it will be very difficult!) - -Or you can simply copy/paste some pre-made schemes into the lines in your session file. - -Copy or rename your original session file someplace safe, then copy the above lines and paste them into your session file, replacing the lines that define `Colour0` through `Colour21`. - -Close and reopen KiTTY and restart your session. Voilà! Now, aren't those colors better? No? Then try some others: - -### X Dotshare - -``` -Colour0\215,208,199\ -Colour1\255,255,255\ -Colour2\21,21,21\ -Colour3\21,21,21\ -Colour4\255,137,57\ -Colour5\215,208,199\ -Colour6\16,16,16\ -Colour7\64,64,64\ -Colour8\232,79,79\ -Colour9\210,61,61\ -Colour10\184,214,140\ -Colour11\160,207,93\ -Colour12\225,170,93\ -Colour13\243,157,33\ -Colour14\125,193,207\ -Colour15\78,159,177\ -Colour16\155,100,251\ -Colour17\133,66,255\ -Colour18\109,135,141\ -Colour19\66,113,123\ -Colour20\221,221,221\ -Colour21\221,221,221\ -``` - -### Zenburn - -``` -Colour0\220,220,204\ -Colour1\220,220,204\ -Colour2\63,63,63\ -Colour3\63,63,63\ -Colour4\115,99,90\ -Colour5\0,0,0\ -Colour6\77,77,77\ -Colour7\112,144,128\ -Colour8\112,80,80\ -Colour9\220,163,163\ -Colour10\96,180,138\ -Colour11\195,191,159\ -Colour12\240,223,175\ -Colour13\224,207,159\ -Colour14\80,96,112\ -Colour15\148,191,243\ -Colour16\220,140,195\ -Colour17\236,147,211\ -Colour18\140,208,211\ -Colour19\147,224,227\ -Colour20\220,220,204\ -Colour21\255,255,255\ -``` - -### Chalkboard - -``` -Colour0\217,230,242\ -Colour1\217,111,95\ -Colour2\41,38,47\ -Colour3\41,38,47\ -Colour4\217,230,242\ -Colour5\217,230,242\ -Colour6\0,0,0\ -Colour7\50,50,50\ -Colour8\195,115,114\ -Colour9\219,170,170\ -Colour10\114,195,115\ -Colour11\170,219,170\ -Colour12\194,195,114\ -Colour13\218,219,170\ -Colour14\115,114,195\ -Colour15\170,170,219\ -Colour16\195,114,194\ -Colour17\219,170,218\ -Colour18\114,194,195\ -Colour19\170,218,219\ -Colour20\217,217,217\ -Colour21\255,255,255\ -``` - -### Dark Pastel - -``` -Colour0\255,255,255\ -Colour1\255,94,125\ -Colour2\0,0,0\ -Colour3\0,0,0\ -Colour4\187,187,187\ -Colour5\255,255,255\ -Colour6\0,0,0\ -Colour7\85,85,85\ -Colour8\255,85,85\ -Colour9\255,85,85\ -Colour10\85,255,85\ -Colour11\85,255,85\ -Colour12\255,255,85\ -Colour13\255,255,85\ -Colour14\85,85,255\ -Colour15\85,85,255\ -Colour16\255,85,255\ -Colour17\255,85,255\ -Colour18\85,255,255\ -Colour19\85,255,255\ -Colour20\187,187,187\ -Colour21\255,255,255\ -``` - -### Dotshare - -``` -Colour0\215,208,199\ -Colour1\255,255,255\ -Colour2\21,21,21\ -Colour3\21,21,21\ -Colour4\255,137,57\ -Colour5\215,208,199\ -Colour6\16,16,16\ -Colour7\64,64,64\ -Colour8\232,79,79\ -Colour9\210,61,61\ -Colour10\184,214,140\ -Colour11\160,207,93\ -Colour12\225,170,93\ -Colour13\243,157,33\ -Colour14\125,193,207\ -Colour15\78,159,177\ -Colour16\155,100,251\ -Colour17\133,66,255\ -Colour18\109,135,141\ -Colour19\66,113,123\ -Colour20\221,221,221\ -Colour21\221,221,221\ -``` - -### IC Green Ppl - -``` -Colour0\217,239,211\ -Colour1\159,255,109\ -Colour2\58,61,63\ -Colour3\58,61,63\ -Colour4\66,255,88\ -Colour5\217,239,211\ -Colour6\31,31,31\ -Colour7\3,39,16\ -Colour8\251,0,42\ -Colour9\167,255,63\ -Colour10\51,156,36\ -Colour11\159,255,109\ -Colour12\101,155,37\ -Colour13\210,255,109\ -Colour14\20,155,69\ -Colour15\114,255,181\ -Colour16\83,184,44\ -Colour17\80,255,62\ -Colour18\44,184,104\ -Colour19\34,255,113\ -Colour20\224,255,239\ -Colour21\218,239,208\ -``` - -### Monokai Soda - -``` -Colour0\196,197,181\ -Colour1\196,197,181\ -Colour2\26,26,26\ -Colour3\26,26,26\ -Colour4\246,247,236\ -Colour5\196,197,181\ -Colour6\26,26,26\ -Colour7\98,94,76\ -Colour8\244,0,95\ -Colour9\244,0,95\ -Colour10\152,224,36\ -Colour11\152,224,36\ -Colour12\250,132,25\ -Colour13\224,213,97\ -Colour14\157,101,255\ -Colour15\157,101,255\ -Colour16\244,0,95\ -Colour17\244,0,95\ -Colour18\88,209,235\ -Colour19\88,209,235\ -Colour20\196,197,181\ -Colour21\246,246,239\ -``` - -### Seafoam Pastel - -``` -Colour0\212,231,212\ -Colour1\100,136,144\ -Colour2\36,52,53\ -Colour3\36,52,53\ -Colour4\87,100,122\ -Colour5\212,231,212\ -Colour6\117,117,117\ -Colour7\138,138,138\ -Colour8\130,93,77\ -Colour9\207,147,122\ -Colour10\114,140,98\ -Colour11\152,217,170\ -Colour12\173,161,109\ -Colour13\250,231,157\ -Colour14\77,123,130\ -Colour15\122,195,207\ -Colour16\138,114,103\ -Colour17\214,178,161\ -Colour18\114,148,148\ -Colour19\173,224,224\ -Colour20\224,224,224\ -Colour21\224,224,224\ -``` - -There are more and of course, you can create your own. - -There you have it. KiTTY over PuTTY for portability. Color scheme changes and a host of other features unique to KiTTY make it my terminal client software of choice when I have to use Windows. - -## Reference - -- [KiTTY Homepage](http://www.9bis.net/kitty/?page=Welcome&zone=en) -- [Color Schemes](http://putty.org.ru/themes/index.html) - The page is in Russian - but you can see the RGB codes for each scheme by clicking on them -- [Notepad++](https://notepad-plus-plus.org/download/v6.8.6.html) \ No newline at end of file diff --git a/blog - LXC Cheatsheet.md b/blog - LXC Cheatsheet.md deleted file mode 100644 index 56e5b10..0000000 --- a/blog - LXC Cheatsheet.md +++ /dev/null @@ -1,113 +0,0 @@ -# LXD/LXC cheat sheet - -I've installed LXD on my home server and have found a lot of syntax and one-liners that I've yet to commit to memory. So I'll put them here. - -## Install LXD - -```shell -snap install lxd -sudo apt install -y git build-essential libssl-dev python3-venv python3-pip python3-dev zfsutils-linux bridge-utils -``` - -## General links - -* [How to initialize LXD again](https://blog.simos.info/how-to-initialize-lxd-again/) - -## Install lxdMosaic - -[link](https://github.com/turtle0x1/LxdMosaic) - -```shell -# Launch an ubuntu container -lxc launch ubuntu: lxdMosaic -# Connect to ubuntu console -lxc exec lxdMosaic bash -# Download the script -curl https://raw.githubusercontent.com/turtle0x1/LxdMosaic/master/examples/install_with_clone.sh >> installLxdMosaic.sh -# Then give the script execution permissions -chmod +x installLxdMosaic.sh -# Then execute the script -./installLxdMosaic.sh -``` - -## Create zsf pool image file and add it to lxc - -```shell -# bs = blocksize, count = number of blocks - -# create the image file - 250GB -dd if=/dev/zero of=/mnt/data1/overlook-zfs-pool02 bs=1GB count=250 -# Create the loop device (check `df -h` first for available names) -sudo losetup /dev/loop6 /mnt/data1/overlook-zfs-pool02 -# Create zfs pool -sudo zpool create overlook-zfs-pool02 /dev/loop6 -# View existing zpool list -zpool list -# Add new zpool to lxc storage -lxc storage create overlook-zfs-pool02 zfs source=overlook-zfs-pool02 -``` - -* [block sizes and multiples](https://www.linuxnix.com/what-you-should-know-about-linux-dd-command/) -* [How to use a file as a zpool](https://serverfault.com/questions/583733/how-to-use-a-file-as-a-zpool) - -## How to move containers to a new storage pool on the same host - -[link](https://discuss.linuxcontainers.org/t/how-to-move-containers-to-a-new-storage-pool-on-the-same-host/2798) - -```shell -lxc stop container_name -lxc move container_name temp_container_name -s new_storage_pool -lxc move temp_container_name container_name -lxc start container_name -``` - -## Changing existing containers to use the bridge profile - -Suppose we have an existing container that was created with the default profile, and got the LXD NAT network. Can we switch it to use the bridge profile? - -Here is the existing container. - -```shell -lxc launch ubuntu:x mycontainer - -Creating mycontainerStarting mycontainer -``` - -Let’s assign mycontainer to use the new profile "bridgeprofile". - -```shell -lxc profile assign mycontainer bridgeprofile -``` - -Now we just need to restart the networking in the container. - -```shell -lxc exec mycontainer -- systemctl restart networking.service -``` - -* [Change lxc profile for container](https://blog.simos.info/how-to-make-your-lxd-containers-get-ip-addresses-from-your-lan-using-a-bridge/) - - -## /etc/netplan/ for containers - -```shell -network: - ethernets: - eth0: - addresses: - - 192.168.0.206/24 - gateway4: 192.168.0.1 - nameservers: - addresses: [ 1.1.1.1, 8.8.8.8 ] - version: 2 -``` - -## backup (export) containers to a file -```shell -bdate=$(date +"%Y-%m-%d") && for ct in $(lxc list -c n --format csv); do lxc export $ct /mnt/data2/container-backup/$bdate-$ct.tgz; done -``` - -## restore container from backup -``` -lxc import /.tgz -``` \ No newline at end of file diff --git a/blog - fun with ISOs.md b/blog - fun with ISOs.md deleted file mode 100644 index f2014f9..0000000 --- a/blog - fun with ISOs.md +++ /dev/null @@ -1,76 +0,0 @@ -# All About ISO's - -## Create ISO from DVD - -Get the info of the cd/dvd you're copying. - -```shell -isoinfo -d -i /dev/sr0 | grep -i -E 'block size|volume size' -``` - -Sample Output: - -```shell -Logical block size is: 2048 -Volume size is: 2264834 -``` - -We use the Logical block size for the `bs=` variable and Volume size for the COUNT= - -use DD to copy the DVD to an iso: - -```shell -dd if=/dev/sr0 of=/mnt/incoming/test.iso bs=2048 count=2264834 -``` - -Sample Output: - -```shell -2264834+0 records in -2264834+0 records out -4638380032 bytes (4.6 GB, 4.3 GiB) copied, 373.405 s, 12.4 MB/s -``` - -### Test the image against the actual DVD - -Get checksum of DVD and newly created image - -Image - -```shell -md5sum /mnt/incoming/test.iso -``` - -Sample Output: - -```shell -d3a2cdd58b8c9ade05786526a4a8eae2 /mnt/incoming/test.iso -``` - -DVD - -```shell -md5sum /dev/sr0 -``` - -Sample Output: - -```shell -d3a2cdd58b8c9ade05786526a4a8eae2 /dev/sr0 -``` - -## Create ISO from files/directories - -Examples - -```shell -mkisofs -J -l -R -V "eBooks" -iso-level 4 -o /tmp/eBooks.iso ~/ownCloud/calibre-library/ - -mkisofs -allow-lowercase -R -V "eBooks" -iso-level 4 -o /tmp/eBooks.iso /mnt/calibre-library -``` - -## Mount ISO Image - -```shell -mount -o loop -t iso9660 /tmp/CalibreLibrary2018.iso /tmp/OldLibrary -``` \ No newline at end of file diff --git a/blog - fun with find.md b/blog - fun with find.md deleted file mode 100644 index f41c39f..0000000 --- a/blog - fun with find.md +++ /dev/null @@ -1,62 +0,0 @@ -# Fun with Find - -## Find the total size of certain files within a directory branch - -```bash -find -type f -iname '*-bin*' -exec du -ch {} + -``` - ---- - -## Find files larger than... - - -### 100M: - - -```bash -find . -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' -``` - -### 1G: - - -```bash -find . -type f -size +1000000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' -``` - -...and so on... - ---- - -## Find, archive and purge old files - -```bash -# Find disk space used by logfiles older that 360 days -find /var/log/hbase -type f -iname "*log*" -mtime +360 -exec du -ch {} + - -# Archive those files to another location -find /var/log/hbase -type f -iname "*log*" -mtime +360 -print0 | xargs -0 tar cfz /tmp/hbase-logs.tgz - -# Delete the original files -find /var/log/hbase -type f -iname "*log*" -mtime +360 -delete -``` - -Replace `hbase` with the log directory you want to search. If you don't need to save the archives anywhere, skip step two. - -[Reference](https://www.cyberciti.biz/faq/linux-unix-find-tar-files-into-tarball-command/) - ---- - -## Find files by group and mode - -Note: *from Teachingbooks web directory permission fix.* at OverDrive - -Find files that have `group: www-data` and current `permissions: 644`, then update the permissions to 664 - -```bash -find -type f -group www-data -perm 644 -exec ls -al {} \; -find -type f -group www-data -perm 644 -exec chmod g+w {} \; -``` - -[Reference](https://ostechnix.com/find-files-based-permissions/) \ No newline at end of file diff --git a/blog - fun with mysql.md b/blog - fun with mysql.md deleted file mode 100644 index 9d884bd..0000000 --- a/blog - fun with mysql.md +++ /dev/null @@ -1,24 +0,0 @@ -# MySQL Tricks - -## dump all MySQL databases at once - -```bash -for i in $(mysqlshow -uroot -p | awk '{print $2}' | grep -v Databases); do mysqldump -uroot -p $i > $i.sql; done -``` - -## mysqldump without the artwork - -Often you want to get results from the mysql client without all the ASCII box table formatting and column names. - -The `-B` or `--batch` option will force the output to be TAB delimited no matter where the output is going. - -The `-N` option will turn off column names in the output. - -The following outputs the result of the query in TAB delimited format without column names: - -```bash -mysql -B -N -e "select distinct table_schema from information_schema.tables" -``` - -Tags: - howto \ No newline at end of file diff --git a/blog - fun with youtube-dl.md b/blog - fun with youtube-dl.md deleted file mode 100644 index 04f246f..0000000 --- a/blog - fun with youtube-dl.md +++ /dev/null @@ -1,40 +0,0 @@ -# youtube-dl/yt-dlp - -youtube-dl is a free and open source download manager for video and audio from YouTube and over 1,000 other video hosting websites. - -## yt-dlp - -yt-dlp is a [youtube-dl](https://github.com/ytdl-org/youtube-dl) fork based on the now inactive [youtube-dlc](https://github.com/blackjack4494/yt-dlc). The main focus of this project is adding new features and patches while also keeping up to date with the original project - -### Install - -```shell -sudo apt install ffmpeg lame #dependencies that are nice to have -sudo wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp && sudo chmod a+rx /usr/local/bin/yt-dlp -``` - -### Extract audio from YouTube video with youtube-dl -```shell -youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" -``` - -### Download Album from YouTube Music -```shell -yt-dlp --extract-audio --audio-format mp3 -o "%(playlist_index)s - %(title)s.%(ext)s" -``` - -This one grabs the metadata (which includes YouTube Music URL in the comments) and best audio - -```shell -yt-dlp -f "bestaudio" --extract-audio --embed-metadata --audio-format mp3 -o "%(playlist_index)s - %(title)s.%(ext)s" -``` - -### Download all parts of a multistream - -```shell -yt-dlp -S "res:480" -``` - -## Reference -* [youtube-dl (original)](https://ytdl-org.github.io/youtube-dl/index.html) -* [yt-dlp](https://github.com/yt-dlp/yt-dlp/#installation) \ No newline at end of file diff --git a/config - Calibre Content Server css.md b/config - Calibre Content Server css.md deleted file mode 100644 index 581f962..0000000 --- a/config - Calibre Content Server css.md +++ /dev/null @@ -1,39 +0,0 @@ -This is the one I've used the most and I want to try others, so I need to save this one someplace. - -```css -@import url(https://fonts.googleapis.com/css?family=Bitter); -@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono); - -body.calibre-viewer-paginated { - font-family: "Bitter", "Ubuntu Mono" !important; - font-size: 100%; - text-indent: 2em !important; - line-height: 150% !important; - padding: 10px; - word-wrap: break-word; - } - -p, p.footnote { - font-family: "Bitter", "Ubuntu Mono" !important; - font-size: 100%; - word-wrap: break-word; - } - -strong, emi, i { - color: #ffffcc; -} - -h1, h2, h3, h4, h5, h6 { - font-family: "Bitter", serif; - font-weight: 600; - line-height: 150% !important; - text-align: left; - color: #ffcc00; -} - -span {display: inline;} - -img {max-width: 100%;} - -hr {border: 2px solid; border-radius: 2px;} -``` \ No newline at end of file diff --git a/howto - SSH keygen.md b/howto - SSH keygen.md deleted file mode 100644 index 1e8d415..0000000 --- a/howto - SSH keygen.md +++ /dev/null @@ -1,7 +0,0 @@ -# SSH Keygen - -## Generate an SSH Key with a comment - -```shell -ssh-keygen -C "comment" -f -``` \ No newline at end of file diff --git a/quotes.txt b/quotes.txt deleted file mode 100644 index 50de3e9..0000000 --- a/quotes.txt +++ /dev/null @@ -1,60 +0,0 @@ -"Being human totally sucks most of the time. Video games are the only thing that make life bearable." -"First do it, then do it right, then do it better." -"...you get to keep as many notes as you can physically produce; the system limits are pretty much beyond your reach. There will be practical limits, however once you get to (say) 50,000 notes, Finagle's law will probably kick in." -"Some time later, she leaned over and kissed me. It felt like all those songs and poems had promised it would. It felt wonderful. Like being struck by lightning." -"I'd come to see my rig for what it was: an elaborate contraption for deceiving my senses, to allow me to live in a world that didn't exist. Each component of my rig was a bar in a cell where I had willingly imprisoned myself." -"Capitalism would inch forward, without my actually having to interact face-to-face with another human being. Which was exactly how I preferred it, thank you." -"The ability to mute my peers was one of my favorite things about attending school online, and I took advantage of it almost daily." -"I tried to keep my cool. I tried to remain skeptical. I reminded myself that I was a man of science, even if I did usually get a C in it." -"Whenever I saw the sun, I reminded myself that I was looking at a star." -"The collected knowledge, art, and amusements of all human civilization were there, waiting for me. But gaining access to all of that information turned out to be something of a mixed blessing. Because that was when I found out the truth." -"Growing up as a human being on the planet Earth in the twenty-first century was a real kick in the teeth. Existentially speaking." -"You're probably wondering what's going to happen to you. That's easy. The same thing is going to happen to you that has happened to every other human being who has ever lived. You're going to die. We all die. That's just how it is." -"What happens when you die? Well, we're not completely sure. But the evidence seems to suggest that nothing happens. You're just dead, your brain stops working, and then you're not around to ask annoying questions anymore." -"No one in the world gets what they want and that is beautiful." -"I know the future is scary at times. But there's just no escaping it." -"I realized, as terrifying and painful as reality can be, its also the only place where you can find true happiness. Because reality is real." -"You don't live in the real world... You're like me. You live inside this illusion." -"One person can keep a secret, but not two." -"For a bunch of hairless apes, we've actually managed to invent some pretty incredible things." -"You'd be amazed how much research you can get done when you have no life whatsoever. Twelve hours a day, seven days a week, is a lot of study time." -"Talking to girls was out of the question. To me, they were like some exotic alien species, both beautiful and terrifying." -"We sat there awhile, holding hands, reveling in the strange new sensation of actually touching one another." -"It comes and goes. Some people have it for five seconds. Some their whole lives. He's a receiver now. Everything's coming in. He can't stop it, he can't slow it down, he can't even figure it out. It's like he's in a tunnel with a flashlight. But the light only comes on every once in a while. He gets a glimpse of something, but not enough to know what it is. Just enough to know it's there." -"You can choose a ready guide in some celestial voice. If you choose not to decide, you still have made a choice." -"That the powerful play goes on, and you may contribute a verse." -"Only in their dreams can men be truly free. 'Twas always thus, and always thus will be." -"No matter what people tell you, words and ideas can change the world." -"Is it better for a man to have chosen evil than to have good imposed upon him?" -"We can destroy what we have written but we cannot unwrite it" -"When a man cannot choose he ceases to be a man" -"The important thing is moral choice Evil has to exist along with good in order that moral choice may operate Life is sustained by the grinding opposition of moral entities" -"Goodness is something chosen When a man cannot choose he ceases to be a man" -"Its funny how the colors of the real world only seem really real when you watch them on a screen" -"I believe our adventure through time has taken a most serious turn." -"All we are is dust in the wind, dude." -"Strange things are afoot at the Circle K." -"Oh, you beautiful babes from England, for whom we have traveled through time. Will you go to the prom with us in San Dimas? We will have a most triumphant time." -"Party on, dudes." -"Oh, he's very popular Ed. The sportos, the motorheads, geeks, sluts, bloods, wastoids, dweebies, dickheads - they all adore him. They think he's a righteous dude." -"You're still here? It's over. Go home. Go." -"The place is like a museum. It's very beautiful and very cold, and you're not allowed to touch anything." -"Roads? Where we're going, we don't need roads." -"I finally invent something that works!" -"There's that word again. 'Heavy.' Why are things so heavy in the future? Is there a problem with the Earth's gravitational pull?" -"If my calculations are correct, when this baby hits 88 miles per hour, you're gonna see some serious sh*t." -"1.21 gigawatts!" -"If you're gonna build a time machine into a car, why not do it with some style?" -"Help me, Obi-Wan Kenobi. You're my only hope" -"I find your lack of faith disturbing." -"You don't need to see his identification...These aren't the droids you're looking for." -"She may not look like much, but she's got it where it counts, kid." -"That's no moon. It's a space station." -"If you strike me down I shall become more powerful than you can possibly imagine." -"I Am The Eyes And Ears Of This Institution, My Friends." -"Does Barry Manilow Know That You Raid His Wardrobe?" -"Don't Mess With The Bull, Young Man. You'll Get The Horns." -"Could You Describe The Ruckus, Sir?" -"It Is Now 7:06. You Have Exactly 8 Hours And 54 Minutes To Think About Why You Are Here To Ponder The Error Of Your Ways." -"Screws Fall Out All The Time. The Worlds An Imperfect Place." -"Were All Pretty Bizarre. Some Of Us Are Just Better At Hiding It; That's All."