Do you spend money on domains and hosting frequently? Well then this is the time to take out your wallet. Visit Bluehost Black Friday – Cyber Monday Offers to read more.
Linux has powerful logging capabilities that can be invaluable when diagnosing a problem, but when left unchecked can amount to a sizeable amount of your hard disk being consumed. How big? Well when I was starting out with Linux a couple of years ago, I didn’t know that such detailed logfiles were being stored; so went along my merry way until one day I stumbled across a 300+MB messages file in /var/log/. The problem was that my computer was never on in the early hours of the morning when the logrotate cron job was set to go off.
As you can guess this is oriented towards Linux being used as a desktop, but feel free to edit parts of this as you go along to accommodate for a longer log-life. All the instructions in this post need to be run with super user privileges; so use sudo or su. First up is to edit the logrotate configuration file:
# For more details, see “man logrotate”.
# rotate log files daily:
# keep 7 days worth of backlogs:
# create new (empty) log files after rotating old ones:
# uncomment this if you want your log files compressed:
That’s how my configuration file is laid out: it creates a backup of all the log file daily and starts overwriting the first at day eight. You can test your configuration by going:
logrotate -f /etc/logrotate.conf
So what’s cron? cron or crond (the cron daemon) is like the Windows Task Scheduler. It uses a simple syntax to run your scripts automatically at a given time. To make it easier, it also provides the concept of run parts to run everything in a directory, so you don’t have to edit to accommodate for every single script you want to schedule. For instance if you want a script to run daily, just plonk it into the /etc/cron.daily/ directory and you’re done.
Of course the next logical question is when do the cron.daily scripts get run? Well they’re probably going to be running early in the morning when your desktop is turned off, so you’ll want to fix that by editing through a convenient little program called crontab. Crontab is basically the vi editor set up to edit cron files. Vi can be a pain, so if you’re not used to it have a look at this excellent quick reference. The run parts, that is the cron.daily/weekly etc. directories should be run as root, so edit through crontab:
crontab -e root
# Run daily cron jobs at 20:40 every day:
40 20 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null
Now you’re done, just make sure you actually have the logrotate script in the /etc/cron.daily directory, and that it has executable permissions, if you don’t then it should go something like this:
chmod 750 logrotate
Over the last few weeks I’ve been having some problems with motivation. There are really two problems: the lack of it and having it in the wrong places. I’m mostly back to normal, but now I really want to redefine what is normal to me. Moreover I already know what I felt as normal behaviour two years ago is different to what I feel now. Really I’m part of the way to achieving my aim–I know that I have changed, so it’s logical to think I can change again. Of course the problem is that while changing over years has been a subconscious process, the new change will have to be an active conscious process.
This is where you want to be, and you have to define what your end is so you can reach it, and not get sidetracked. Motivation can be incredibly dangerous since once you’ve got it, by definition your life should become consumed by it. Motivation seems to be associated with advancing your career, or earning more money, but really it should only be in what gives meaning to your life.
You don’t want to become an obsessive business type who only values their career for their career’s sake. But that’s not to say that you shouldn’t aim to be rich and good at your career. You shouldn’t have any delusions; money is the springboard that brings you to meaning behind your life–but what about relationships and things you cry? Well, I’m sure you can appreciate that even if you have the most appealing personality in the world, you’re going to find it extremely hard to show it to anyone when you’re in the gutter and preoccupied with finding your next meal.
Though there’s a problem: once you have achieved something that you want, you can’t just burn the bridges you travelled along to get there. Take the example of someone travelling around the world, while you should take time off work, you can’t just pack it in altogether. Sure you want to add meaning to your life, but you’ve also got to make sure you can enjoy the things that add meaning, and to do this you have to do things that will be less desirable. You can have the most extravagant aims and desires, but to succeed in them you’ve got to be realistic. Being realistic doesn’t mean that you should compromise your dreams, instead it’s just a way of achieving them. Once you’ve got things like taxes sorted out then you are in a much better standing point to achieve.
Have you ever seen the film Collateral? There’s the perfect example of someone who never gets any closer to what they really desire because they don’t want to take risks. I can’t remember the specifics, but Jamie Foxx plays a taxi driver called Max. Max insists that driving a taxi is only a temporary job, but it comes to light that he has been doing it for years, and his real desire resides in a photo of a beautiful island that he looks at every so often when he’s feeling down. It isn’t the fact that he has a job as a taxi driver, but instead that he wishes he hadn’t. You’re never going to change anything unless you actually do something, and sometimes doing something is risky. I’m not telling you that it will always turn out right, I’m just saying that’s the deal: it doesn’t always turn out right.
It isn’t humanly possible to be 100% focused on your aims 100% of the time. This fact means that sometimes you might resent yourself for spending time on things that don’t seem to contribute in any way to your plans. Also there’s the fact that sometimes you are incapable of trying to learn something new, or doing something you know you need to do to advance. An example of this is having writer’s block, I used to hate myself like mad when I couldn’t put something down onto a piece of paper. The answer? Do something different quickly before you start associating creativity or writing with a bad feeling. I used to find swimming or going for a walk helped. Physical exercise fills your body with natural endorphins that make you feel more relaxed and with that sometimes more creative.
Some days everything will just slot into place, other days nothing that you want to do will work. The trick is finding something that you can do on those days when you think you have no control over things that is guaranteed to make you feel at the steering wheel again. Don’t keep up a futile struggle of plugging away at something when you know things won’t work, the second you associate something with negativity makes it all the harder to pick it up and try again some other time, because you’ll have the preconception that what you’re trying to do will only make you feel bad.
This is different to patience and perseverance. This isn’t an excuse just to give up on something, I’m saying do something different if you find yourself getting in the state of mind where you think it’s totally futile. Perseverance is all about sitting down to do something hard with it in your mind that you can do something and you will do it–even if it metaphorically kills you.
Micro Managing is not a Necessity
While some people might find that micro-managing is the most productive way of achieving things, I can’t agree. I find that micro-managing in theory is much easier to do than in practice. Also the time it takes to devise a to-the-hour schedule could in itself be better spent on other things. When I was revising for my exams, I can remember teachers actually giving us time in lessons to create a daily revision plan, recommending to give each subject an allocated hour in your day. I found this to be entirely impractical, however this does vary person to person–someone else may find micro-managing the ideal way of doing things. But I just find that if you plan everything too carefully, and don’t allow for the unexpected, then your carefully laid plans can go to waste, making your day feel unfulfilled. If you know that you have to do things like revise for a lesson, make sure you do it, but be flexible. Also you might just feel like doing something on the spur of the moment, as the saying goes: “There’s no time like the present”. Have a mental list of what you want to do in a day, but I think it’s going a bit far to say “this is when I’m doing this, and this is when I’m doing that”.
Stop Pissing Around
The elegant term for this is procrastination–go to any affluent teenager’s blog and you’ll probably hear this word mentioned. Procrastinators are perfectionists; it’s a vicious circle, they want to achieve perfection, but don’t want to go about doing so unless they know they can achieve it. I always use the word piss around instead of procrastinate as the former has more negative connotations. Correct diagnosis is the first step to a cure, and using such an elegant term for such a crappy state of mind is doing yourself no favours.
Carefully Balance Inspiration and Achievement
I find films to be a great source of inspiration, seeing people on the screen who are successful in whatever they do makes me want to emulate their behaviour. Eric S. Raymond’s How to Be A Hacker was one of the catalysts that got me interested in the field of computing. However I am quite aware that there is a difference between walking the walk, and talking the talk. You’ve actually got to knuckle down to things yourself instead of reading endless things like: “Which is the right distro for me?” Or “Which programming language should I learn first?” You’ll find yourself trawling the internet addicted to hearing about what other people recommend. I think you just have to get to a where you should dive headlong into something, and make your own mistakes.
For instance there’s no better way to realise the benefits of Object Oriented programming than to realise you can’t salvage anything from the code soup you created a couple of months ago–it having all made sense at the time. In the case of Object Oriented programming it sometimes takes longer to implement something using classes than what it does to implement something procedurally, but in the long run you can go back to it and access everything through the logical abstraction you created. This is an example of putting more effort into something for the long term instead of focusing on short-term gratification. For those among you who are not programmers, here’s how I would connect to my database with PHP:
$connection = new DatabaseConn($password, $username, $hostname, $dbname);
I think anyone can see that’s a pretty easy way to connect to a database.
So, there you have it, advice from a person who loosely follows what he says, but would like to follow it more.