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.
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:
m-x ibuffer
* /
to mark all buffers in dired modeD
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:
- MySQL 8.0: Improved performance with CTE
- MySQL 8.0.2: Introducing Window Functions
- mysql-shell
- 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 tig
:
Tab
: Switch to next viewR
: Reload and refresh the current view#
: Toggle line numbers on/off~
: Toggle (line) graphics modee
: Open file in editor:<sha>
: Jump to a specific commitf
: 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:
2. 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.
finished Python Crash Course, not bad. but looks like python is really easy, very similar to javascript + php
the only surprise thing to me ispython prefers list comprehension over map and filter, and reduce is moved to funtools
package.
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.
Blog Archive
- Newer Entries
- 2017 October
- 2017 November
- 2017 December
- 2018 January
- 2018 February
- 2018 March
- 2018 April
- 2018 May
- 2018 June
- 2018 July
- 2018 August
- 2018 September
- 2018 October
- 2018 November
- 2018 December
- 2019 January
- 2019 February
- 2019 March
- 2019 April
- 2019 May
- 2019 July
- 2019 October
- 2019 November
- 2019 December
- 2020 August
- 2020 September
- 2020 October
- 2020 November
- 2020 December
- 2021 January
- 2021 February
- 2021 March
- 2021 April
- 2021 May
- 2021 June
- 2021 August
- 2021 September
- 2021 December
- 2022 March
- 2022 April
- 2022 May
- 2022 June
- 2022 July
- 2022 August
- 2022 September
- 2022 October
- 2022 November
- 2022 December
- 2023 January
- 2023 February
- 2023 March
- 2023 April
- 2023 July
- 2023 August
- 2023 September
- 2023 October
- 2023 November
- 2023 December
- 2024 January
- 2024 February
- 2024 March
- 2024 April
- 2024 May
- 2024 June
- 2024 August
- 2024 September
- 2024 October
- 2024 November
- 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