virsh reload xml config file
If you have made any changes to a libvirt xml config file you have to reload is. One way is to reload the whole libvirtd service. But you can just reload corresponding domain xml too:
$ virsh define foo.xml
Related cards:
How to inspect XML files in a terminal
You can use xmllint
to pretty-print ugly XML files on your terminal. Just say:
xmllint --format file.xml
That will restructure containers nicely into individual sections with proper indentation.\
Note that it will automagically work on gz...
Traverse large XML files with Nokogiri
If you need to parse a large XML file (> 20 MB or so), you should parse it in chunks, otherwise it will need lots of memory.
Nokogiri offers a reader that lets you parse your XML one node at a time.
Given an XML library.xml
with this content
...
Nokogiri: How to parse large XML files with a SAX parser
In my case [...] the catalog is an XML that contains all kinds of possible products, categories and vendors and it is updated once a month. When you read this file with the Nokogiri default (DOM) parser, it creates a tree structure with all bran...
Passenger 5/6 requires a config.ru file to run Rails 2.3 projects
Put the following into config.ru
in your Rails root folder:
# Require your environment file to bootstrap Rails
require ::File.dirname(__FILE__) + '/config/environment'
# Dispatch the request
run ActionController::Dispatcher.new
Otherw...
Rails: Using custom config files with the config_for method
You can use the config.x configuration in combination with config_for
to configure global settings for your Rails 4.2+ application.
Example
In your `config/application....
Check apache config files' syntax
To check your apache2 config files for syntax errors run
sudo apache2ctl configtest
or shorter
sudo apache2ctl -t
Be aware that this does not guarantee a successful Apache startup. It may still fail due to permission errors, etc.
git "fatal: bad config file line" after checking out branch
If git gives you an error message such as "fatal: bad config file line 123 in .git/config" after you tried to checkout a branch with a very long branch name, you very likely come across a bug in git version < 1.8.
You should ask someone with a ne...
Webpack: Automatically generating an icon font from .svg files
Over the years we have tried several solution to have vector icons in our applications. There are many ways to achieve this, from SVGs inlined into the HTML, SVGs inlined in CSS, JavaScript-based solutions, to icon fonts.
Out of all these options...
Configuring Git with .gitconfig
Basic configuration
Please keep this config simple. It should be a starting point for new developers learning Git.
[user]
name = Your Name
email = your.name@domain.com
[branch]
sort = -committerdate
[color]
ui = auto
[color "bra...
Asset pipeline: Precompile non-standard manifests
By default, only application.js
, application.css
and all non-JS/CSS files are precompiled into public/assets
.
If you have asset manifests in non-standard locations, declare them in your config/application.rb
:
config.assets.precompile...