Listing posts
Displaying posts 6 - 10 of 327 in total~~~ * ~~~
extract first frame from animated GIF
Last update
2024-03-06
2024-03-06
« — »
1 2 3 4 5 | # from file convert image.gif[0] first_frame.gif # from stdin cat image.gif | convert -'[0]' first_frame.gif |
Source: stackoverflow
~~~ * ~~~
Linux default date & time format
Last update
2024-03-04
2024-03-04
« — »
- find your current locale
1 2 | locale | grep LC_TIME
# => LC_TIME="en_US.UTF-8"
|
edit the corresponding file
/usr/share/i18n/locales/en_US
change values to your liking:
1 2 3 4 | d_t_fmt "%a %d %b %Y %T %Z" d_fmt "%Y//%m//%d" t_fmt "%T" date_fmt "%a %d %b %Y %T %Z" |
- regenerate locales and re-login
1 2 | locale-gen update-locale |
Source: linuxopsys
~~~ * ~~~
Rails bin/dev via GNU screen
Last update
2024-03-01
2024-03-01
«run Procfile.dev within GNU screen»
Prepend to bin/dev
:
1 2 3 4 5 6 7 8 | if command -v screen &> /dev/null; then rc_file="tmp/screenrc" grep -E -v "^(screen|select|source) " $HOME/.screenrc 2> /dev/null > $rc_file nl bin/Procfile.dev | \ sed -r 's/^\s*([0-9]+)\s*([^:]+): (.+)/split\nfocus\nscreen -t \2 \1 \3/' | \ tail -n +3 >> $rc_file exec screen -c $rc_file fi |
Source: kyrylo.org and overmind
~~~ * ~~~
Rails memory/speed up tips
Last update
2024-02-29
2024-02-29
«deploy rails at maximum performance
puma multiworker | passenger
with nginx balancer»
puma multiworker | passenger
with nginx balancer»
- https://www.speedshop.co/2015/07/22/secrets-to-speedy-ruby-apps-on-heroku.html
- https://www.speedshop.co/2015/07/29/scaling-ruby-apps-to-1000-rpm.html
- https://www.sitepoint.com/ruby-uses-memory/
- https://www.speedshop.co/2017/10/12/appserver.html
- https://www.speedshop.co/2018/03/28/nginx-unit-for-ruby.html
- https://www.ombulabs.com/blog/rails/performance/notes-from-the-complete-guide-to-rails-performance-workshop.html wrk test, law & formulas
- https://jakeyesbeck.com/2019/06/18/ruby-processes-and-threads/
- https://evilmartians.com/chronicles/big-on-heroku-scaling-fountain-without-losing-a-drop
- https://medium.com/rubyinside/how-we-halved-our-memory-consumption-in-rails-with-jemalloc-86afa4e54aa3
- https://justin.searls.co/posts/brand-new-rails-7-apps-exceed-heroku-s-memory-quotas/
source: reddit