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 .txt$ to mark all
.txt files. then use
! zip output.zip * to apply,
* here represents marked files.
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:
* /to mark all buffers in dired mode
Dto kill them
Wednesday, September 06, 2017
started using pass to manage passwords.
$ 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
$ pass git init $ pass git push $ pass git pull
not much special about this article: Why favor PostgreSQL over MariaDB / MySQL
since people mentioned about mysql 8.0.2 supports window functions, found out that I don't know many things about mysql:
- MySQL 8.0: Improved performance with CTE
- MySQL 8.0.2: Introducing Window Functions
- X Protocol
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
Wednesday, September 13, 2017
I decided to learn python, reading Python Crash Course now.
Wednesday, September 20, 2017
I found myself using more and more
Tab: Switch to next view
R: Reload and refresh the current view
#: Toggle line numbers on/off
~: Toggle (line) graphics mode
e: Open file in editor
:<sha>: Jump to a specific commit
f: Switch to (file) blob view
can find file with fuzzy search
g: Switch to grep view
find content in any files
b: Switch to blame view.
s: Switch to status view.
here, you can stage / unstage files (like
git add -i), and press
C to commit (calls external
git commit command).
for more details check the tig manual
taken from 30 interesting commands for the Linux shell:
- Kill program using one port sudo fuser -k 8000/tcp 4. Rename selected files using a regular expression rename 's/\.bak$/.txt/' *.bak 13. Grep with Perl like syntax (allows chars like \t) grep -P "\t" 16. Run command every time a file is modified while inotifywait -e close_write document.tex do make done 20. Randomize lines in file shuf file.txt 27. Create empty file of given size fallocate -l 1G test.img 29. Monitor the progress in terms of generated output cat /dev/urandom | base64 | pv -lbri2 > /dev/null
Thursday, September 21, 2017
Java 9 will release today.
the best talk I've seen on Java 9 is Clojure, Java 9, and You - Toby Crawley
I think a lot of Java 9 articles are coming.
the only surprise thing to me ispython prefers list comprehension over map and filter, and reduce is moved to
lambda only uses for one-liner function.
I also tried reading Fluent Python, quite low level, and to be honest I don't like magic methods.
now reading Effective Python: 59 Specific Ways to Write Better Python, so far so good.
also reading a free book: Fast Data Architectures for Streaming Applications
it is a good introduction on modern big data architectures, recommended.
- Older Entries
- 2017 August
- 2017 July
- 2017 June
- 2017 May
- 2017 April
- 2017 March
- 2017 February
- 2017 January
- 2016 December
- 2016 November
- 2016 October
- 2016 September
- 2016 August
- 2016 July
- 2016 June
- 2016 May
- 2016 April
- 2016 March
- 2016 February
- 2016 January
- 2015 December
- 2015 November
- 2015 October
- 2015 September
- 2015 August
- 2015 July
- 2015 June
- 2015 May
- 2015 April
- 2015 March
- 2015 February
- 2015 January
- 2014 December
- 2014 November
- 2014 October
- 2014 September
- 2014 August
- 2014 March
- 2014 February
- 2014 January
- 2013 December
- 2013 October
- 2013 July
- 2013 June
- 2013 May
- 2013 March
- 2013 February
- 2013 January
- 2012 December
- 2012 November
- 2012 October
- 2012 September
- 2012 August