Saturday, September 02, 2017

use emacs as file manager, c-x d to select a directory

| >       | next directory                    |
| <       | previous directory                |
| ^       | up one directory                  |
| c-s     | search                            |
| j       | jump to file                      |
| +       | create directory                  |
| c-x c-f | create file                       |
| s       | sort toggle between date and name |
| g       | refresh                           |
| R       | rename                            |
| C       | copy                              |
| D       | delete                            |
| +       | create directory                  |
| Z       | compress/uncompress               |
| q       | quit                              |

to mark files:

| m   | mark file      |
| u   | unmark         |
| U   | unmark all     |
| %-m | mark by regexp |

to zip multiple file, first use %-m &#46;txt$ to mark all .txt files. then use ! zip * to apply, * here represents marked files.

hit g to refresh, you'll see the zip file, enter to browse content inside (Zip-Archive mode, q to exit)

editable dired mode:

| c-x c-q | enter editable |
| c-c c-c | apply changes  |
| c-c esc | cancel changes |

to clear dired buffers:

  1. m-x ibuffer
  2. * / to mark all buffers in dired mode
  3. D to kill them

Wednesday, September 06, 2017

started using pass to manage passwords.

to initiate:

$ pass init [gpg-id]

create new password:

$ pass insert mysql/dev-root

retrieve it from clipboard:

$ pass -c mysql/dev-root

password in clipboard will be cleared after 45 seconds.

to generate random passwords:

$ pass insert mysql/dev-root 15

integrate with git:

$ pass git init
$ pass git push
$ pass git pull

not much special about this article: Why favor PostgreSQL over MariaDB / MySQL

more interesting are discussions on hackernews and reddit

since people mentioned about mysql 8.0.2 supports window functions, found out that I don't know many things about mysql:

I'm reading The Language of SQL (2nd Edition), not deep, so it's good to me.

the book's examples are for ms sql, but it also lists out compatibility with oracle and mysql.

I learned some of limitation about mysql from it, accidentally learned some new things about mysql 8.

I bookmarked this article: JOIN Elimination: An Essential Optimiser Feature for Advanced SQL Usage

didn't have time to read it before, I'll do it once finished reading the SQL book.

this tutorial teaches you How to Build a Simple Database

I always like this kind of stuffs, build some important components from scratch. not necessarily for serious use, but you'll know what is a good service looks like and what is the difficult part of it.

I begin to write a pub-sub server, I'll do load balancer next. I think that will be fun.

saw one colleague using lua script for redis, I should give it a try as well.

but I want to know when should you use lua script instead of redis clients.

lua script blocks, and redis is single-threaded.

it should be something quick and lua makes clean.

a guide to begin:

Thursday, September 07, 2017

finished The Language of SQL (2nd Edition), not bad.

now reading Designing Data-Intensive Applications, it is a very good one.

chapter 3 starts by a bash version key-value database, then apply different index solution from there. super easy to understand.

Saturday, September 09, 2017

aws announced Network Load Balancer

it's a level 4 load balancer with fixed IP and cross zones. also provided health checks on targets.

this will be super useful if you have custom services running. a static ip means no cname and ip cache problem. aws maintain the floating ip for you.

I had to setup a nfs server with failover before, I wish this was available at that time.

nginx released NGINX Unit

to be honest I don't see the point yet.

Vagrant 2.0 is out.

I still prefer vagrant over docker

vagrant is the whole environment, containers are just processes, you'll need docker compose or kubernetes or you own bash to maintain the relationships

Blog Archives

Search Blog: