-bash: /bin/rm: Argument list too long

I accidentally created more than 50K empty files in a folder. When I tried to remove them using rm -rf *.tmp, I got the error -bash: /bin/rm: Argument list too long. It turns out bash tries to expand the * into a full list, but that list became too long. Here is how to delete that many files: [code] find . -name ‘*.tmp’ | xargs rm [/code] Ref: https://yooplug.com/portal/plugin/support_manager/knowledgebase/view/45/deleting-tons-of-files-in-linux-argument-list-too/ https://www.tidyhosts.com/blog/resolve-binrm-argument-list-long-error/

March 5, 2018 · 1 min · birdchan

Why do flight times differ between traveling East vs traveling West?

I often notice that when I fly from America to China, then fly back. It’s off by an hour or two. Earth rotation shouldn’t be the reason unless we get out to the space. I did some research and it turns out it’s the wind. Make sense. https://aviation.stackexchange.com/questions/2549/why-do-flight-times-differ-between-traveling-east-versus-traveling-west

February 27, 2018 · 1 min · birdchan

/usr/local/Homebrew/Library/Homebrew/brew.rb:12:in `': Homebrew must be run under Ruby 2.3! You're running 2.0.0. (RuntimeError)

[code] brew update brew install ruby [/code]

February 19, 2018 · 1 min · birdchan

World’s most spoken languages

World’s most spoken languages, based on # of first-language speakers‬ ‪ ‬ ‪1. Chinese (Mandarin) 935M‬ ‪2. Spanish 390M ‪3. English 365M ‪4. Hindi 295M ‪5. Arabic 280M 6. Portuguese 205M‬ ‪7. Bengali 200M ‪8. Russian 160M‬ ‪9. Japanese 125M‬ ‪10. Punjabi 95M … https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers What does that mean?

February 13, 2018 · 1 min · birdchan

A list of 25 Principles of Adult Behavior by John Perry Barlow

1. Be patient. No matter what. 2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him. 3. Never assume the motives of others are, to them, less noble than yours are to you. 4. Expand your sense of the possible. 5. Don’t trouble yourself with matters you truly cannot change. 6. Expect no more of anyone than you can deliver yourself. 7. Tolerate ambiguity. 8. Laugh at yourself frequently. 9. Concern yourself with what is right rather than who is right. 10. Never forget that, no matter how certain, you might be wrong. 11. Give up blood sports. 12. Remember that your life belongs to others as well. Don’t risk it frivolously. 13. Never lie to anyone for any reason. (Lies of omission are sometimes exempt.) 14. Learn the needs of those around you and respect them. 15. Avoid the pursuit of happiness. Seek to define your mission and pursue that. 16. Reduce your use of the first personal pronoun. 17. Praise at least as often as you disparage. 18. Admit your errors freely and soon. 19. Become less suspicious of joy. 20. Understand humility. 21. Remember that love forgives everything. 22. Foster dignity. 23. Live memorably. 24. Love yourself. 25. Endure. ...

February 10, 2018 · 1 min · birdchan

HTTP GET request body

I was developing a RESTful API. When done with the basic select/insert/update, I needed to implement endpoints for batch queries. All of a sudden, I was like, how do I pass in the list of ids? Is there some standards out there? I was thinking of using POST. That was how I did it back then, simple and easy. But with the REST philosophy, or the http way of things, I wanted to stick with GET. ...

February 9, 2018 · 2 min · birdchan

Thousands comma numeric formatting in psql

[code] select trim(both ’ ’ from to_char(12345678.49, ‘999,999,999.99’)) [/code] The trim is to take away the white space from the sides. Ref: https://www.postgresql.org/docs/9.6/static/functions-formatting.html

February 8, 2018 · 1 min · birdchan

Deep-copying in JavaScript

Good stuff. http://dassur.ma/things/deep-copy/

January 30, 2018 · 1 min · birdchan

Meltdown and Spectre

Meltdown Meltdown breaks the most fundamental isolation between user applications and the operating system. This attack allows a program to access the memory, and thus also the secrets, of other programs and the operating system. Spectre Spectre breaks the isolation between different applications. It allows an attacker to trick error-free programs, which follow best practices, into leaking their secrets. In fact, the safety checks of said best practices actually increase the attack surface and may make applications more susceptible to Spectre ...

January 23, 2018 · 1 min · birdchan

pip install pycurl

I ran pip install pycurl and got crazy error [code] Collecting pycurl Downloading pycurl-7.43.0.1.tar.gz (195kB) 100% |████████████████████████████████| 204kB 6.0MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File “/tmp/pip-build-msc3b_98/pycurl/setup.py”, line 104, in configure_unix stdout=subprocess.PIPE, stderr=subprocess.PIPE) File “/usr/lib/python3.5/subprocess.py”, line 947, in __init__ restore_signals, start_new_session) File “/usr/lib/python3.5/subprocess.py”, line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: ‘curl-config’ During handling of the above exception, another exception occurred: ...

January 19, 2018 · 2 min · birdchan