writelatex.com is awesome. Edit your $LaTeX$ document and see the changes almost immediately.
Category: Uncategorized
-
Collaborative online $\LaTeX$ documents
writelatex.com is awesome. Edit your $LaTeX$ document and see the changes almost immediately.
-
Collectd causing rrd illegal attempt to update using time errors
I found collectd causing rrd illegal attempt to update using time errors. I was seeing a whole load of lines like this in my syslog:
Aug 20 16:27:12 mythbox collectd[32167]: rrdtool plugin: rrd_update_r (/var/lib/collectd/rrd/mythbox/df-root/df_complex-free.rrd) failed: /var/lib/collectd/rrd/mythbox/df-root/df_complex-free.rrd: illegal attempt to update using time 1345444032 when last update time is 1345444032 (minimum one second step)
It was adding one message like that every second so my logs were completely full of it. Google didn’t reveal much except that this sort of error is either because there are two instances of RRD trying to write the RRD database at the same time, or that my server’s date and time are way out of sync. Neither of these were true in my case.
I asked on #collectd on freenode and a very nice person by the name of tokkee told me that it’s a known issue of sorts. The df plugin for collectd uses /proc/mount to determine which drives to check free space on and if / is in there twice, it tries to update the entry for / twice and causes the problem.
The solution is to add the following to the /etc/collectd/collectd.conf file:FSType "rootfs" IgnoreSelected true Then I restarted collectd and my logs were peaceful again.
Update 2014-04-10:
I was getting these errors again on one of my VPS hosts. In this instance, / only appeared once in /proc/mounts but /run was in there multiple times:root@new:/etc/collectd# cat /proc/mounts rootfs / rootfs rw 0 0 /dev/root / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0 devtmpfs /dev devtmpfs rw,relatime,size=1085360k,nr_inodes=271340,mode=755 0 0 tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=217328k,mode=755 0 0 tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=460860k 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0 root@new:/etc/collectd#
The solution is to ignore tmpfs instead of rootfs:
FSType "tmpfs" IgnoreSelected false -
Choosing passwords for the 21st century
The recent Mat Honan hack got me thinking about password strength. It turns out he was hacked not due to having a poor password, but because of a security flaws in Amazon and Apples’ systems. Nevertheless it serves as a good reminder to keep yourself safe.
One thing you can do is use very long passwords for important things. Increasing the length of your password can make it seriously more difficult for anyone to brute force attack your password.
To get an idea of the impact a long password, have a look at this site: How Big is your Haystack. It lets you type in a password and it gives you an idea of how long it would withstand a brute force attack for. Obviously don’t type your real password in, but type in something that uses the same number of letters, numbers, capitals and punctuation and see how it looks.
8 lower case letter passwords? 2.17 seconds in an offline attack scenario. It’s not until you get up to 17 lower case letters that it pushes the offline attack scenario into the the virtually impossible range.
So how do you go about picking a strong password?
Diceware. Essentially you roll a dice 25 times to form 5 groups of 5 numbers. Then you look each number up in the list of words to generate a 5 word password. Being 5 words makes it relatively easy to remember but also very long.
If you don’t feel like rolling dice, you could consider using random.org to generate a list of numbers for you. If you choose this approach, make sure to visit the site using https and get a nice long list and choose a set of numbers from the list. Write it down on a piece of paper and put it in a safe place. Note this is not as secure as using the offline dice rolling approach.
As a final note, consider using multi factor authentication if you can. Google have made it available for gmail and I recommend you sign up for it. -
CSS Arrows
cssarrowplease makes lovely speech bubbles in pure CSS.
-
Twenty Twelve WordPress theme
I switched to using the Twenty Twelve WordPress theme a few days ago. I really am liking it although I’m not sure about the header image being below Site Title and Tag Line. That looks a little strange to me.
Having said that, I think Twenty Twelve looks fantastic on the demo site.
Currently you have get Twenty Twelve from the WordPress trac repository as as far as I know it is not released yet. They will release it as a stand alone theme soon I believe, so you can try it out before WordPress 3.5 is released.
I did agit clone
of the WordPress code mirror on github, into my home directory. Then I symlinked the~/wordpress-git/wp-content/themes/twentytwelve
directory to my live WordPress install path. That way I can simply do agit pull
to update the theme. -
\(\LaTeX\) Equations in WordPress using MathJax
I came accross this great tool for displaying mathematical equations the other day. MathJax not only supports \(\LaTeX\) syntax but also renders the equations as pure text, so no unsightly images and they scale beautifully. You can also right click on the equation and see it’s \(\LaTeX\) code.
The code for MathJax is open source, but if you don’t want to go to the bother of installing it yourself, you can use it on their CDN.
There are a couple of plugins to enable MathJax in WordPress. I’m using the Simple MathJax plugin. I’ve not tried the others.
To use MathJax simply mark up your equation with\[…\]
. If you want to have an equation inline, use\(…\)
. You can also inline equations in the post title.
Here are a few examples taken from the MathJax site:The Lorenz Equations
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x – y – xz \\
\dot{z} & = -\beta z + xy
\end{aligned}The Cauchy-Schwarz Inequality
\[\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)\]
A Cross Product Formula
\[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
\end{vmatrix}\]The probability of getting \(k\) heads when flipping \(n\) coins is
\[P(E) = {n \choose k} p^k (1-p)^{ n-k}\]
An Identity of Ramanujan
\[\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
{1+\frac{e^{-8\pi}} {1+\ldots} } } }\]A Rogers-Ramanujan Identity
\[1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
\prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
\quad\quad \text{for $|q|<1$}.\]Maxwell’s Equations
\begin{aligned}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
\nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} -
\(\LaTeX\) Equations in WordPress using MathJax
I came accross this great tool for displaying mathematical equations the other day. MathJax not only supports \(\LaTeX\) syntax but also renders the equations as pure text, so no unsightly images and they scale beautifully. You can also right click on the equation and see it’s \(\LaTeX\) code.
The code for MathJax is open source, but if you don’t want to go to the bother of installing it yourself, you can use it on their CDN.
There are a couple of plugins to enable MathJax in WordPress. I’m using the Simple MathJax plugin. I’ve not tried the others.
To use MathJax simply mark up your equation with\[…\]
. If you want to have an equation inline, use\(…\)
. You can also inline equations in the post title.
Here are a few examples taken from the MathJax site:The Lorenz Equations
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x – y – xz \\
\dot{z} & = -\beta z + xy
\end{aligned}The Cauchy-Schwarz Inequality
\[\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)\]
A Cross Product Formula
\[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
\end{vmatrix}\]The probability of getting \(k\) heads when flipping \(n\) coins is
\[P(E) = {n \choose k} p^k (1-p)^{ n-k}\]
An Identity of Ramanujan
\[\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
{1+\frac{e^{-8\pi}} {1+\ldots} } } }\]A Rogers-Ramanujan Identity
\[1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
\prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
\quad\quad \text{for $|q|<1$}.\]Maxwell’s Equations
\begin{aligned}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
\nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} -
\(\LaTeX\) Equations in WordPress using MathJax
I came accross this great tool for displaying mathematical equations the other day. MathJax not only supports \(\LaTeX\) syntax but also renders the equations as pure text, so no unsightly images and they scale beautifully. You can also right click on the equation and see it’s \(\LaTeX\) code.
The code for MathJax is open source, but if you don’t want to go to the bother of installing it yourself, you can use it on their CDN.
There are a couple of plugins to enable MathJax in WordPress. I’m using the Simple MathJax plugin. I’ve not tried the others.
To use MathJax simply mark up your equation with\[…\]
. If you want to have an equation inline, use\(…\)
. You can also inline equations in the post title.
Here are a few examples taken from the MathJax site:The Lorenz Equations
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x – y – xz \\
\dot{z} & = -\beta z + xy
\end{aligned}The Cauchy-Schwarz Inequality
\[\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)\]
A Cross Product Formula
\[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
\end{vmatrix}\]The probability of getting \(k\) heads when flipping \(n\) coins is
\[P(E) = {n \choose k} p^k (1-p)^{ n-k}\]
An Identity of Ramanujan
\[\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
{1+\frac{e^{-8\pi}} {1+\ldots} } } }\]A Rogers-Ramanujan Identity
\[1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
\prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
\quad\quad \text{for $|q|<1$}.\]Maxwell’s Equations
\begin{aligned}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
\nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} -
Event Cinemas’ lousy customer service comes good
Recently I went to see Dark Knight Rising with my wife. The volume in the cinema was too loud and we didn’t enjoy it because of that. My wife went out to complain to the only person she could find. A security guard who couldn’t be arsed to do anything about it. He said he would “try” but there was no change in the volume that we could detect. I find this trend in increasing volume in cinemas to be disturbing.
On the plus side, they actually have a ticketing system for complaints.
On the negative side, at first their response was lousy but after a bit more complaining they improved. Conversation follows:Hi,
on 6/8/2012 at 8:20pm session in cinema 8 i saw Dark Night Rising.
Right from the start of the movie it was too loud. My wife and I felt uncomfortable at the noise level.
After a while my wife left the cinema to complain. She spoke to the security guard on the ticket collection stand. He said he would “try to do something” but there was no detectable change in the volume level. it really was too loud during the action scenes and consequently we left the cinema with ringing ears. My ears continued to ring all night long.
I don’t really like to think I paid good money to have hearing damage. I’m not quite sure what was wrong with your setup but the system failed us on two counts.
1. it was too loud to begin with. you should have systems in place to ensure it is not too loud.
2. when we complained about it, your staff did nothing to rectify the situation.
I might also add that on leaving the cinema, we felt like complaining but the place was deserted except for the same security person who did nothing in the first place.
This is not the kind of experience I expect from the Event Cinema brand and frankly I doubt I will be attending an Event Cinema again for quite some time.
Yours, Jason.To which they replied with the fairly lack lustre:
Hi Jason,
Thank you for contacting us.
Customer Service is of the upmost priority to us. We do endevour to make the cinema going experience the best for each individual & we can assure you that it is very rare that we receive feedback about our film volume levels. Please know that we do appreciate you bringing this to our attention and will contact the appropriate parties so this doesn’t happen again.
We hope that you will attend our cinemas again in the near future.
Kind Regards,
E Support – Event Cinemas George StreetThis riled me up a little and I sent them this:
Wow, I’m pretty surpprised that you couldn’t even manage an apology. And not only that, your email aludes to perhaps the issue is my ears rather than your sound configuration.
In order for me to go to the cinema, I need to organise baby sitting. It’s not easy to get to the cinema, and when we got there, it was uncomfortably loud and your staff couldn’t be bothered to even fix it.
I’m very disappointed.which apparently got their attention:
Hi Jason,
Please let me sincerely apologies for the interruption to your movie experience. As a mother of 5 myself I do know how difficult it actually is to get some time out from the kids to attend any outing. If you would like to forward your address to us, we are more than happy to provide you with some passes for you to come back & watch a movie at a time that suits you.
We will definately speak to our staff & the security company to ensure that any issues like this are looked after appropriately & accordingly.
Thank you for taking the time out to give us your feedback. It is feedback like this that we take on board seriously & use to better our service.