Your time 4 | |
Neat and simple horizontal page scrolling, and cool design. |
libgrader | |
Find quality gems for your next project. | |
Rails meets React | |
(book) still under progress, but already accessible. | |
PackageCloud | |
Public and private package repositories with powerful tooling, security and automation. | |
CloudSlang | |
Automate your DevOps use cases using ready-made workflows. | |
Linux performance | |
Very neat gathering of tools for deep Linux observability. | |
Devbattles | |
IT community for professionals. |
Spina | |
A CMS built upon the Rails framework. | |
Waterfall | |
A tool to chain ruby services and blocks. | |
acts_as_localized | |
Localization accessor mechanism for AR models. | |
Polymer 1.0 | |
Announced at Google IO, here is the first major release of this web component framework. | |
Leasot | |
Parse and output TODOs and FIXMEs from comments in your files. | |
Passenger 5.0.8 | |
New Debian packages, Red Hat packages, bug fixes. | |
Gitlab 7.11 | |
Two-factor Authentication, look and feel upgrade, and more. |
Remote Control Your Mac With Node.js and Arduino | may 25 |
Not really remote, more like an external keypad. | |
Implementing 'the lovely' Singleton Pattern | may 26 |
The good part of singleton. | |
Boldly refactoring complex code | may 26 |
By using github's scientist gem. | |
Recursion in Ruby | may 26 |
Exemple of adding a head_tail method to array to ease up recursion. | |
Rails Quick Tips: Easy ActiveRecord Optimizations | may 27 |
Use select, any?, empty?, and pluck to boost the query performance. | |
How to delegate methods in Ruby | may 27 |
5 ways of forwarding your work to some other object in Ruby. | |
Orchestrate Containers for Development with Docker Compose | may 27 |
It was known as Fig, now it's docker-compose. | |
Build Custom User Analytics with Parse | may 28 |
Parse is an IaaS from Facebook with a large free tier. | |
Ruby’s Exception vs StandardError: What’s the difference? | may 29 |
Why you should never rescue Exception in ruby. | |
CoffeeScript classes with React - pros and cons | may 31 |
You can use CoffeeScript classes to create React components (since 0.12). |
RubyTapas Freebie: Sequel (5m) | may 26 |
The good part of sequel gem. | |
Docker Swarm (23m) | may 27 |
11th of the Docket Tutorial collectiopn. |
Recently I found my self again in that situation on a linux server. The partition where logs are stored went 100%. In such case, It's clever top purge old useless logfiles. Typical move for me would be to run logrotate manually with
logrotate -f /etc/logrotate.conf
But I had a case where that was not enough. A developer forgot to remove a debugging output and the logs were just gathering way too much information, more than what I could free with some janitoring.
To avoid losing logs, we can move the logfile where there is space and replace the file with a symbolic link. That's good enough for until the partition gets resized of the logs get cleaned. But when it's done on a live logfile, the running process that writes into it still has the same file descriptor. The process has to be relaunched so the new fd can be taken in account, on the new partition, as instructed by the symbolic link.
So a colleague pointed out that could be done without restart by using gdb. It's a pretty neat trick (if you have gdb installed on your production server, which may not always be the case, and for good reasons). Anyways I had it at hand, and here is the sequence:
touch /path/to/new/logfile gdb -p pid (gdb) call dup(1) $1 = 3 (gdb) call close(1) $2 = 0 (gdb) call open("/path/to/new/logfile", 2) $3 = 1 (gdb) call close($1) $4 = 0 (gdb)
This gave me the taste of digging up a little bit more on how gdb can interact with live processes.