16. February, 2014
Snapper is a nice tool to revert changes made to your system.
Unfortunately, it has a nasty side effect: If you happen to delete some large files (say, an ISO image you accidentally copied to the wrong place), and that large file ended up in one of your snapshots, well … the file will be gone but the disk space will still be allocated.
The first step is to locate the large file(s) under /.snapshots
The next step is to delete it/them. That’s not so easy since snapper created read-only file system snapshots. The workaround is to create a writable snapshot, delete the files, delete the read-only snapshot, create a new one and then delete the writable snapshot. Too much on one sentence? Here is the sequence of commands:
btrfs subvolume snapshot snapshot snapshot.bak
rm -rf snapshot.bak/...
btrfs subvolume delete snapshot
btrfs subvolume snapshot -r snapshot.bak snapshot
btrfs subvolume delete snapshot.bak
Breakdown: First, we cd into the folder which contains the snapshot itself (it also contains a file “info.xml”).
Then we clone the snapshot in “snapshot.bak” which we can modify.
The last three steps replace “snapshot” with the new, cleaned “snapshot.bak”.
In at least one occasion, that didn’t free the disk space, yet. I also had to delete the oldest snapshot which contained the file.
1. February, 2014
We don’t see things how they are, but how we are.
As Sheldon from Big Bang Theory said: “Text adventures run on the world’s most powerful graphics chip: Imagination!“
Everything you see or hear happens in your brain.
Think about it.
That insult that really hurt? Only in your brain.
Interesting, isn’t it?
Just beware of the “everything is my fault” concept. There is no point in trying to take responsibility for everything.
29. January, 2014
When working with Git, you’ll eventually realize that an important part is the workflow: How many branches do I need? How do I organize them? How does code flow between them?
Vincent Driessen is sharing his workflow in “A successful Git branching model“
Another great resource is “Atlassian Git Tutorials” and especially the “Git Workflows” section.
17. January, 2014
I just looked at an article in the Oracle Java FAQ and I was a bit surprised to get this result:
從 Java 7 Update 51 版本開始導入了例外網站清單功能。藉由將應用程式 URL 新增至「例外」清單，可讓使用者執行通常會被安全檢查封鎖的「豐富網際網路應用程式 (Rich Internet Applications, RIA)」。[...]
The solution was pretty simple: Append ?locale=en to the end of the URL: http://www.java.com/de/download/faq/exception_sitelist.xml?locale=en
That fixed it for me … sometimes.
16. January, 2014
This is a summary of the steps to upgrade from Xtext 2.3 to 2.4:
- The plugin org.eclipse.xtext.xtend2.lib has been renamed to org.eclipse.xtend2.lib
- In the *.mwe2 file of your DSL, replace EcoreGeneratorFragment with EMFGeneratorFragment
- Run the *.mwe2 script to regenerate the whole project
- Merge plugin.xml_gen and plugin.xml
10. January, 2014
During the Flask presentation yesterday, I learned about an Easter egg in Python: “import this” which will print:
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one– and preferably only one –obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea — let’s do more of those!