Understanding your type of cronjob Some cronjobs must only run on a single server. E.g. when you run nightly batch operations on the database, it should probably run on a...

...single server. Running it on multiple servers would likely result in deadlocks or corrupt data. Some cronjobs must always run on all servers. E.g. starting a sidekiq process on reboot...

Sometimes you need to access a dev server running on localhost from another machine that is not part of the same network. Maybe you want to use your phone to...

...the past, we often used some port forwarding or other techniques to expose the service to the internet. Enter ngrok, a command line tool that gives you an on-the...

When your Rails application server raises error, Capybara will fail your test when it clears the session after the last step. The effect is a test that passes all steps...

%r{No route matches .*"/uploads/test/\d+-[\d\-]+/[^"]+"}i, ].freeze def raise_server_error! super rescue StandardError => e # Ignore errors about missing source maps unless IGNORE_MESSAGES.any? { |ignore_message...

...who is managing the identity provider (IDP). But you can setup a local keycloak server to act as your IDP to play around with. This might seam intimidating, but is...

...ADMIN_PASSWORD=admin --volume ./keycloak_data:/opt/keycloak/data/h2/ quay.io/keycloak/keycloak:24.0.2 start-dev The database of the server is persistent and stored in keycloak_data. You can stop the container and restart it...

This Capistrano task runs a command on all servers. bundle exec cap production app:run cmd='zgrep -P "..." RAILS_ROOT/log/production.log' Code # lib/capistrano/tasks/app.rake namespace :app do # Use e.g. to grep logs...

...on all servers: # b cap production app:run_cmd cmd='zgrep -P "..." RAILS_ROOT/log/production.log' # # * Use RAILS_ROOT as a placeholder for the remote Rails root directory. # * Append ` || test $? =1;` to...

Sometimes, the rails dev server doesn't terminate properly. This can for example happen when the dev server runs in a RubyMine terminal. When this happens, the old dev server...

...blocks port 3000, so when you try to start a new server, you get the error: Address already in use - bind(2) for "127.0.0.1" port 3000 (Errno::EADDRINUSE)

On application servers, gems are usually bundled into the project directory, at a location shared across deployments. This is usually shared/bundle inside your project's root directory, e.g. /var/www/your-project/shared/bundle/.

...the number of releases grows, junk clogs up the hard drive of our application servers: Old release code Old tmp folders with compiled view templates etc. Precompiled assets (Javascripts, images...

...will symlink the public/assets directory to shared/assets. This is cool since we can still serve previous assets after a new release, in the window where browser caches might still have...

There is a reasonable simple way to move data between Redis servers: Simply temporarily configure the new server as a replica of the old server. To do this:

...the new Redis server can access the old server. If they are on different networks, a simple SSH tunnel will do. Connect to the new server using redis-cli.

martin-riedl.de

...live-streaming HLS, filled with real-world examples. Using FFmpeg as a HLS streaming server (Part 1) – HLS Basics Using FFmpeg as a HLS streaming server (Part 2) – Enhanced HLS...

Using FFmpeg as a HLS streaming server (Part 3) – Multiple Bitrates Using FFmpeg as a HLS streaming server (Part 4) – Multiple Video Resolutions Using FFmpeg as a HLS streaming...

Sometimes you just want to have a small web server that serves files to test something. Serve the current directory On Ruby 1.9.2+ you can do the following ("." for current...

...same way with Python 3.x python -m http.server In both cases your web server is single-threaded and will block when large files are being downloaded from you.

Switch to MariaDB Remove MySQL: sudo apt remove mysql-common mysql-client mysql-server mysql-apt-config Install MariaDB: sudo apt install mariadb-server mariadb-client mariadb-common libmariadb2...

...liberal SQL mode for your app, you must make sure that all developers, staging server and production server use the same SQL mode...

web.archive.org

...more information, see the linked page. cap invoke To run shell commands on all servers, you can also use Capistrano's invoke. Its syntax is a bit more complicated:

...not investigate in the 2342 tools that exist for migrating IMAP accounts from one server to another. They all suck. Try your luck with imapsync. We have no clue why...

...tcp -SecurityTypes None &>/dev/null DISPLAY=":6" Your webdriver will now start within a VNC server (which will only listen to your machine). To take a look, open a VNC viewer...

...the tests will keep running. Custom resolution The X session provided by the VNC server can have a custom resolution. Just pass your preferred resolution like this: -geometry 1280x1024

Unless all MySQL server defaults are set to UTF-8, mysqldump encodes UTF-8 characters incorrectly and only outputs correct UTF-8 when you switch to Latin 1 (!). Also you...

...this, make sure your /etc/mysql/my.cnf looks like this: [mysqld] default-character-set = utf8mb4 collation-server = utf8mb4_unicode_ci [mysql] default-character-set=utf8mb4 After that do sudo /etc/init.d/mysql restart

When your application is running on a multi-server setup, application logs are stored per server (unless you choose a centralized logging solution). Here is a Capistrano task that connects...

...to all servers and prints logs to your terminal like this: $ cap production app:logs 00:00 app:logs 01 tail -n0 -F /var/www/your-application/shared/log/production.log | while read line; do echo "$(hostname...

When you have a multi-server setup, you'll be adding a new server from time to time. Before doing a full deploy, you might want to test that server...

...with is only run for servers matching {:roles=> }, but no servers matched. Instead, specify the server-under-test like this: HOSTFILTER=separate-sidekiq.makandra.de cap production deploy Capistrano is aware of this...

Microsoft Exchange service administrators can enable Exchange Web Services (EWS) which is a rather accessible XML API for interacting with Exchange. This allows you to read and send e-mails...

...what you can do with EWS, with accompanying Viewpoint code. Connecting to an exchange server require 'viewpoint' include Viewpoint::EWS endpoint = 'https://your.exchange.server/ews/Exchange.asmx' user = 'your-user' pass = 'your-password...

The bin/webpack-dev-server command is not as smart as e.g. rails server, where it shows the proper fix within the error message. $ bin/webpack-dev-server yarn run v1.19.1 error Command "webpack-dev-server...

Use the following command to test if a server (in this example: makandra.com on port 443) uses Perfect Forward Secrecy (PFS): openssl s_client -connect makandra.com:443 -cipher ECDHE-RSA-RC4...

...Note that OpenSSL keeps the connection open if PFS is supported. In case the server does not support PFS, it looks like this: ~ > openssl s_client -connect localhost:443 -cipher...

Call with the server's hostname (and user if you have no SSH agent), e.g. install-gems-remotely my.server.com # or without agent: install-gems-remotely me@my.server.com When you call it...

...as the gemspecs of all vendored gems in to a temporary folder on the server and does a bundle install there. If you need to install gems from anothere Gemfile...

Install Ubuntu Server Download an image from this site Select File > New… to and follow the instructions, choose the .iso file you downloaded as image file Deselect "Simple installation" – you...

...session) is running: ps -aux|grep vnc If you see Xvnc4 :17 then the server is already running. Kill this server if it is already running. vncserver -kill :17

...make sure to remove the lockfile of the VNC server you just murdered: rm -f /tmp/.X17-lock Geordi should start the server again when it needs it...