in config/settings.yaml :webpack_dev_server: true
In one tab:
rails s -b '0.0.0.0'
In a 2nd tab:
# curl -o ~/.oh-my-zsh/custom/themes/akofink.zsh-theme https://gist.github.com/akofink/3c9dbb65826eeb632a5250ce38a5fb8e/raw/1cdd0136aa2e866da763d62d913e898103cb4d43/akofink.zsh-theme | |
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
function prompt_char { | |
if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi | |
} |
-- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration | |
-- Listen on all interfaces (localhost would not work in Docker) | |
net.listen('0.0.0.0') | |
net.listen('0.0.0.0', 853, {tls=true}) | |
-- Auto-maintain root TA | |
trust_anchors.file = '/data/root.keys' | |
-- Load Useful modules |
function kill_servers { | |
# kill node server | |
kill -9 $(ss -tulpn | grep 3808 | awk '{ print $7}' | awk -F'[=|,]' '{ print $3 }') 2> /dev/null | |
#kill rails server | |
if [ -f /home/vagrant/foreman/tmp/pids/server.pid ]; then | |
kill -9 $(cat /home/vagrant/foreman/tmp/pids/server.pid) | |
fi | |
} | |
in config/settings.yaml :webpack_dev_server: true
In one tab:
rails s -b '0.0.0.0'
In a 2nd tab:
In order of first appearance in The Morning Paper.
On hypervisor (probably your workstation)
yum install virt-who
Edit /etc/virt-who.d/test.conf
and update the rhsm_hostname, rhsm_username, rhsm_password (use dev server credentials)
[libvirt]
type=libvirt
server=qemu:///system
owner=Default_Organization
env=Library
#!/usr/bin/ruby | |
password=(ARGV[0] || "changme") | |
orgs=`hammer -p changeme --csv organization list | tail -n+2 | awk -F, {'print $1'}` | |
orgs.split("\n").each do |org| | |
`hammer -p changeme --csv repository list --organization-id #{org} | grep -vi '^ID' | awk -F, {'print $1'}`.split("\n").each do |repo| | |
`hammer -p changeme repository synchronize --id #{repo} --organization-id #{org} --async` | |
end | |
end |
#!/usr/bin/env ruby | |
base=50000 #port | |
range="192.168.121." | |
contents = <<-EOS | |
Listen %{port} https | |
<VirtualHost *:%{port}> | |
ProxyPass / https://%{ip_address}/ | |
<Location /> |
GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/
After discovering it chowing 2 cores, I decided to go about disabling it.
Directories
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time
class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime
steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000