Alex Hughes || microfeeds:
You can have them fresh on your plate everyday using your favourite feed reader: 'http://microfeed.ahughes.org/feed.php'
Special thanks to my friend and colleague Karen for the 5 minute godly touches on my horrible CSS file.
I recently needed to restore a single table from a huge 3GB SQL dump file.
Luckily enough, I found the following solution on Stack Overflow, but I will copy it here, to have it handy.
So, essentially, by replacing "mytable" with the actual table's name, run the following command:sed -n -e '/CREATE TABLE.*mytable/,/CREATE TABLE/p' full_dump.sql > table_dump.sql
I may take it a step further and tell you that if you want to have any commands before the table creation, like USE myschema you should create the table_dump.sql file yourself and then append sed's contents by using the ">>" operator.
Perhaps if you still get errors, you may have to open the file with a decent editor like vim to get rid of certain lines that mysqldump creates. Still a better alternative to opening the entire dump.
A brilliant way of using sed to getting what you want.
If for some reason you want to execute an rsync command and you want to explicitly use password authentication, instead of using your public key, the only thing that you need to do is:rsync -avz --delete -e "ssh -o PubkeyAuthentication=no" ~/files/* user@remote:~/files/
I tend to forget the syntax, so this will act as a reminder now...
Hope this was helpful to you as well.
I am using Ubuntu with KDE as the window manager and from time to time, every single site that uses Adobe Flash, tends to not function properly, showing me the following message:
Now this wouldn't be a problem, but if I click "check for updates" it doesn't seem to find one.
After a bit of googling, I found out that I just need to run the following command on the terminal to fix the problem:sudo apt-get update && sudo apt-get install -y flashplugin-installer
I hope this helps, if you have got the same problem.
If you have ever performed a hard reboot on a CentOS server, you would have noticed that a handful of things can get a bit out of tune.
One of these things is the MySQL server daemon. It would not start automatically, and when you try using:
sudo service mysqld restart
...it gives you the following error message:
Another MySQL daemon already running with the same unix socket.
A quick method to bring your site back online, is to execute the following command:
sudo mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
sudo service mysqld start
The same philosophy probably applies to other flavours of Linux, but the location of the lock file probably differs.
When handling simple strings in Java, chances are that somebody will need to perform a search and replace operation.
There is a rookie mistake one can make (even if he's not a rookie anymore) using the wrong function for the wrong task, mainly because of the unusual naming convention.
For instance, today, I stumbled upon a piece of code that was using the replaceAll() function, even though this was not necessary because it could be using the replace() function instead.
What is the harm though?
The harm was that because of that, the code was buggy and was occasionally throwing the following exception:java.lang.IndexOutOfBoundsException: No group 1 | Pattern matching
All of this, was happening because some symbols of the text were not escaped properly, and the compiler thought that I was trying to use a regular expression.
So, the million dollar question is, what is the difference between replace() and replaceAll()?The replaceAll() and replaceFirst() are functions that use regular expressions. The replace() function DOES NOT.
This means that replaceAll() replaces all occurences, using regex. Consider it like a helper for using regex in a certain way. The replace() function, again replaces ALL, even though its name does not imply so, without using regex.
Because of the above fact, the replaceAll() needs some characters to be escaped in the supplied String, otherwise they will be mistaken for a regex, throwing various annoying exceptions.
So, if all you need to do is a simple find and replace operation without messing with regex, use replace(). It is slightly faster and a lot more foolproof.
Documentation for the replace() here
Documentation for the replaceAll() here
By following this tutorial, one can easily setup a streaming audio server with icecast 2.3.3.
For me everything went well, until I tried to install icegenerator, which is the MP3 streaming client.
While trying to execute the ./configure command, libshout could not be located, causing the configuration to fail.
After some failed attempts along with some failed google searches, I found out the way to force-feed libshout's location by myself.
So, instead of just executing "./configure", try to execute:./configure --with-shout=/opt/icecast/latest
I hope this does the trick for you as well, if you are stuck scratching your head a rainy Sunday morning...
If you have done work and you have commited locally to your repository, only to find that what you have done is rubbish and irrelevant (it hurts, but it happens sometimes) and you want to synchronise to the remote, read on.
First of all, please, do not delete all your local files and then reclone the repository.
You may think I am exaggerating, but I've seen many developers do it.
Instead, use this command:
git reset --hard origin/master
to move back to where the remote origin currently is.
Or, if you are being picky about it, by using the following command:
git reset --hard <sha1-hash-goes-here>
you can reset your head to wherever you want to be.
If only this very last function existed in real life as well, that would be nice...
If you find yourself locked out of your wordpress powered blog/site after executing an upgrade of some sort, do not panic.
While upgrading, wordpress creates a temporary file called .maintenance in the root folder of you blog.
This file is hidden, so you may have to set your FTP client to show hidden files, or perform an ls -a instead of a simple ls in order to see it.
The only thing you have to do is to delete this file and then login again and check the status of everything.
Hope this helps.
Don't save your wings for the summer...
Give up your fear and let it go...
Six years have passed since I chose a certain path in my life for the better or for the worst.
Passion, a lot of passion.
Fights, numerous fights.
Hate, a bit of that too.
But also love. More than everything else.
Circumstances has changed dramatically through the years, but it seems that we adapted in every one of them, probably we can adapt in new ones as well, sooner or later.
I tend to moan and bitch about the British online banking systems, but today I actually remembered that Greek people are in a far worse position than me.
At least with my HSBC account I can send money without commision to all major British banks, usually instantly.
The only thing that annoys me a bit is my secure key (a little device that gives you a one time password after you enter your pin to access you e-banking).
Well today, I had to transfer money from a Greek bank account of mine to another one and I had to pay commision 50 cents. It is not a big amount, but still, they have no right to make money this way in 2014.
I had to find my Greek number sim card in order to receive an "extraPin".
I wonder what happens if somebody loses his phone. First of all it is not secure (somebody can transfer all your money and if he knows how to do it properly with a chain of transactions, the money will be dispersed in various bank accounts, one in Gibraltar, the other one in Canary Islands etc).
But odds are that nothing of the above will happen. I will probably have to travel to Greece, enter a store, waste the time of an employee explaining the situation etc. The bank is wasting its resources and I am wasting my time.
I had to find a way to convert an account number of another bank to an IBAN format. Some may say that this is not a tragedy since calculating an IBAN is easy if you know the account number and the bank.
And I will answer to them, well, if it is not a tragedy, why isn't the bank making this job for you? You lend them your money, they have to provide you with these types of services and make your life a bit easier.
The worst of all is the fact that they would charge me 9 euros if I don't calculate the IBAN.
Now, ladies and gentlemen, I call this a proper white collar theft. They are stealing money from the people that don't have the knowledge and the means to calculate something that THE BANKS invented in order to make transactions easier and safer between different banks.
After the transaction was complete, the final straw has been pulled out for me. I remembered that in 2014, Greek banks, will not transfer the money until Monday morning. And today is Friday night.
There is no way somebody can find an excuse for this in 2014, sorry.
This was the fourth and last hit.
I don't want to imagine having to run a business that transactions happen ofter in Greece. I just don't.
So, you want to protect a couple of directories on your webserver for a handful of reasons, and you successfully did so, with .htaccess files.
But then you discovered that you want a subdirectory inside a protected directory to be public, again for a handful of reasons.
There is a small trick to quickly do that.
Just create a .htaccess file in the subdirectory you want to open to the public, and type in "Satisfy any" - without the quotes.
So, there you have it.
Once again, don't consider apache protected directories a real protection, they only exist for convenience reasons and to keep bots out.
They are very vulnerable to man-in-the-middle attacks.
These days, Ealing Council is resurfacing the road in front of my house.
I was amazed at how quick and efficient the contractors were in performing the task, despite the extreme Health & Safety measures that probably get in the way (numerous notices, signs, regulations).
Probably the main reason that I am so surprised is the other extreme that is usually happening in Greece:
NO Health & Safety measures and extreme inneficiency.
I will try to shoot a video tomorrow with some footage for you to see...
If you are using .htaccess files in order to password protect directories on your server, you may have a bit of a headache setting it up, due to a few configuration details that people tend to forget.
Generally apache has a very straightforward procedure in order to setup and maintain a HTTP server, but it also has many features causing some details to end up hidden within the huge manual files.
Like the following one:
In order to setup password protection with .htaccess files, the first thing you have to do is to set up properly Allow Override in the main config file.
Other than that, be sure that the directory where the .htpasswd file is located, is executable by everyone - (rwxr-xr-x or 755) is what mine looks like.
Always remember, that if apache is giving you a hard time, the first thing you should do, is to take a look at the /var/log/apache/error_log before hitting your head against the wall and start changing conf files.
The last one is also a NOTE-TO-SELF.
My beloved was in Birmingham for a couple of days and she dined in a place called "handmade burger".
She is difficult with food, but she was really pleased with everything. When she was back in London, she proposed that we go there, in order for me to try it out.
Luckily, I live in West London and Wembley is not that far, so we went there for lunch.
I chose a classic burger with cheddar cheese and thick English bacon. The meat of the burger was from Jimmy's Farm.
I have to admit that it was the best burger I had in my life so far. Accompanied with chips, various dips and a house salad dressed with a balsamic vinegar based dressing, it was a very nice meal.
They also do a killer Oreo milkshake and we had it for dessert.
I am looking forward to dine there again, give it a try!
In your asylum
Inside your shell
A pearl slowly forming
But noone can tell
If in the darkness
It sparkles and shines
And there's no way of knowing
If it's all lies
I can't explain but there's something
Unnatural in the way
That you cry
As love turns to hate
Love turns to hate
When using the terminal interface to query a collection within a database in MongoDB, you will find it amusing that all numbers are treated as doubles by default, at least in newer versions.
There is nothing really wrong with that, but if you wrote your code when this was not the default setting, you are in need of a way to force-feed MongoDB an integer.
Well, it is not that difficult in the end. Just use the
NumberInt(117) function,where instead of 117 you pass your desired integer.
The time has come. After overdoing it for several weeks (or months maybe), I am full of toxins and I tend to feel like crap. Something has to be done about this.
This week is going to be really challenging and hard for me:- no carbohydrates
- no salt
- no sugar
Actually, it is a lot quicker to say what is included in the diet instead of what is not.
This is:- egg white
- chicken fillet
I will try to write down updates on my progress as well.
Today I remembered a nice band called Massive Attack. I have completely forgot about them the last year.
This is why I made a radio for them. Check it out here.
This is the first time in a long time that I actually miss my hometown and I feel homesick in general.
My friend Julia today posted the video below, and I saw all the places I used to go alone to get inspired, or walk with good friends and beloved ones to make some memories.
Now that I have been in a handful of European cities, I have to state that Thessaloniki is one of the best cities to live in, being unique and having a very distinctful character.
"When you live far away from a place, you tend to remember the good parts of it and put aside the bad ones"
I remember that when I was about to leave Thessaloniki behind, I was relieved, because in my mind, it represented the problems I had living there. The fact that I "changed glasses" means that I solved most of these problems here in London.
Let's put it this way:
When there is a lot of passion in a relationship, there is no stability. Love can quickly turn to hate because lust is in the way.
Thessaloniki is this kind of woman. London on the other hand, is the woman that can adapt to your needs and give you what you want to make you happy, but it is lacking this passion.
This is how it feels for me, I would fancy a small visit sometime soon.
My office laptop runs Windows, as it is fairly new and Ubuntu is having a hard time with its hardware drivers. This is OK, but the situation with the SSH keys and git is a bit of a mess.
The worst thing is that I cannot rsync and also run handy shell scripts in order to do stuff to remote servers easily.
So, for now, I have my home desktop computer running Ubuntu 12.04.
I used to dislike KDE because for every simple thing I wanted to do, I had to edit a conf file or write a script or get lost in the menus. I also hate Unity with a passion, so I was using Gnome Classic.
One day I was bored and I tried to configure KDE again. Well, it took me about an hour, but going this extra mile, really helped.
I am very pleased with the result and it seems that for some reason it is running more smoothly than Gnome - I don't have a clue why so don't bother asking me.
I am actually so pleased with the result that I am going to try and install ubuntu on my office laptop again.
Today, I just remembered why I stay outside zone 1 and all tourist-friendly areas around London.
People unaware of the term queuing everywhere along with noisy babies and planned engineering works.
I seriously suggest that this situation should be a circle in Dante's inferno.
Other than that, I just realised and agreed with other people as well that the Emirates Airline is out of place, it would have been a lot nicer if it was more central.
It is very cheap though if you are using your pay-as-you-go oyster credit, so what you pay is what you get I guess.
I am a big fan of Toto, I should have made a radio for them already.
Well, I did now, you can enjoy here.
Issues with HTML5 and browsers still exist -licensing issues mainly-, so better use Google Chrome or Safari.
Maybe you are in the process of changing your public key, or for some reason you want to SSH via password.
Usually, all public keys are tried and if they fail, then you are prompted to enter your password.
If for security reasons though you are disconnecting somebody after one try, you will find your self locked out if the key you have is wrong.
A quick way to login and fix things is to SSH using the following option:
ssh -o "PubkeyAuthentication=no" someone@somewhere
End of note to self and hope this helps.
After a long and pleasant journey and service, my laptop's HDD died today.
I tried to boot it up today morning and I heard the so-called "click of death" (see video below).
Not a biggie though, as I went to Strand's maplin and I bought a Western Digital for 69 quid.
I think I can access the dead drive's files if I connect it to my icy-box, but it is the first time that I don't even need to bother, because all of my code is in repositories and my files are in Dropbox or Google Drive, or synced via my tools.
The only real pain is installing everything from scratch and performing all the previous customisations I have done already.
This came to remind me though, that I was totally right for not trusting anything that has mechanical parts and no redundancy methods to keep data safe.
I need to say bye to my evening plans though.
There's a million things I'd like to say
But you turn your back, refuse to hear
So, I keep it inside and watch you walk away
But, the vision and the words, will not disappear
So, what is it that you fear, as you turn your face?
There is more in this world, than meets the eye;
Reality is what we choose to see and believe
There's a million things you'd like to tell
But, I think I've heard it all before
And I know I'm wrong, I know it so well
Never will I listen to you, nevermore
There's a million things I'd like to say
But you turn your back, refuse to hear
So, I keep it inside and watch you walk away
But, the vision and the words, will not disappear
The feelings we've kept inside,
and the tears we've denied
Always remember it's bitter taste
Remember it's token; remember the words
Could this be the one I followed?
Could this be the one I've given faith?
I know I know I know you care...
All at once a star is frozen, all at once my memory fades away but...
I know I know I know you care...
But peace falling into my life, why won't you follow?
Words falling into my way, what do I say?
Gave you all a man could borrow and all the time you've hidden this away.
I know I know I know you care.
Faith falling out of my life, faith, did you fuck him?
Love moving out of my way, why should I stay?
Words from the mouth of my friend and I had to believe him.
When we talked about the things you used to say every second day.
Words take ahold of my memory and history changes.
And if I could just forget it all tonight, that would be alright.
Years falling out of my life, why don't you follow?
Love falling out of the way, why should I stay?
Words falling into my life, what should I write?
P.S. I know I know I know you care...
I prepared a quick radio with his studio albums, you can find it here.
I shall remind you that the plugin works with Chrome and Safari reliably.
One of these days, I remembered of one of the most inspirational modern composers and producers alive, Jean Michel Jarre.
I am preparing a radio for this reason, but for now, you can enjoy two of his best albums on youtube, right below.
Just take some pills and enjoy...
It seems that Facebook is always in need of decent System Engineers.
It actually makes perfect sense.
As I am not interested at this time period for the particular positions, anybody who fits for the role may try his luck...
I came across the following conclusion, after suffering the effects of the Oligopoly in Energy and Communication companies.
Fortunately, here in the UK, the quality of the service as a product (internet connection, stability, etc) is generally good.
The weak point of the Oligopoly is the following:
The companies are aware that the product is not very elastic, meaning you cannot switch easily, so when something goes wrong, the Customer Service is usually something worse than horrible.
So far, this happened both with my office internet connection (British Telecoms) and my home energy supplier (npower).
The first case was a cable fault somewhere in the building. These things happen. What was totally unacceptable though, was the Customer Service being somewhere in India and repeating the same panacea solution for everything.
Well, we are a software house, we know how to setup routers, even though, once again, we hate it with a passion.
After you do all the actions in order to connect to a British Engineering call centre of BT, in order to talk with an engineer about the issue, it is like your complaint is thrown in a black hole that exists in BT HQ.
So you have to call again the next day, waste another good 15 minutes to get through and explain the problem again.
After the Nth try, you can try and start the threats about sueing the company, and maybe something will happen afterwards.
Well, this is totally unacceptable.
I believe that if something is privatised, there should be a government agency "watchdog" that really takes into account everything and gives big fines to the companies.
Probably the latter already exists, but is failing miserably on its mission.
If they actually have something to lose, a bigger chunk of the whole budget may go there and make everybody a bit happier.
I don't believe that privatisation is a daemon, it can be a very good "divide & conquer" idea. Thatcher started it when it was needed, but since then, I believe that the governments should have taken more steps to ensure that British Citizens are actually benefiting from it and not overpaying it.
The fact that I can go to Paris by train cheaper than I can go to Scotland or Wales speaks for itself.
Well, I learned the VERY HARD WAY after wasting one good hour trying to locate a bug, that MySQL transactions also apply to SELECT statements.
Right now, I am really disappointed with myself that I didn't recognised the problem right away -I thought that my application was faster than the MySQL server- and fixed it right away.
So, if you have AUTOCOMMIT off, and you are performing SELECT without commiting, you are going to read old data the second time.
Now I will always remember it. Sometimes you have to learn the hard way.
Nothing is new here underneath the sun
All of the big new charlatans will sneer at us
Barely a flicker of the light to come
Only the people who always think they know best
Well, if for a couple of reasons you want to have a remote directory of a linux server handled like a local one without too much hassle, this is the way to go.
Of course it is a linux-to-linux solution -I use it between two servers in the same network- but if you are a fanatic, there are ways to have SSH for Windows. Google is your friend. Cygwin may be a good place to start.
First of all, essential for this to work is sshfs. Install it by running:
$: sudo yum install sshfs
Now, you must add the user that you want to use in order to login in the fuse group.
For dummies, this is done by running:
$: usermod -a -G fuse username_goes_here
Then, what you need to do is to finally mount the remote directory like this:
$: sshfs a_user@a_host:/remote/path/to/directory /local/path/to/directory
If you want this to happen passwordlessly, then take a look here.
Also, if you want this to happen upon boot -you need passwordless authentication-, then append the following line in /etc/fstab/:
sshfs#a_user@a_host:/remote/path/to/directory /local/path/to/directory/ fuse username_here 0 0
Well, this was my way of having files always available when Dropbox wasn't around. (And when no woman was shutting my computer down ;-)
Here is another Breakfast for Champions - London Edition:
For those absent, here you can find the Scotland Edition.
I am really sad that he is going back to Greece in a short amount of time. I hope that he will do the right thing and come back to live in London.
Easier said than done, but I will be able to have kick-ass breakfast in the morning, kick-ass dinners and kick-ass pints in pubs along with some drunk Irishmen.
Also we can have some kick-ass holidays in Greece, just to keep in touch with the sun occasionally.
My father is in London these days, and he decided to prove that he can cook much better than the Greeks.
And so he did.
It was a great meal that I have missed a lot since I moved to London and I completely enjoyed yesterday.
Here is proof:
So far, the last days, I am impressed with England.
I usually don't talk about politics because it is smalltalk, but I am a human and I have weaknesses too. Also, this time, it is about a war, that the West claims to be in the name of human rights.
The word imperialism is considered to be a synonym with England throughout history.
That's right. We are not talking about Wales and Scotland. They are always minding their own business throughout history.
So, the Prime Minister of the United Kingdom saw the writing on the wall and decided to respect it, which can only be good news.
Yes, people in Syria deserve better days than the current ones, but before US tries to fix the world, it can try to fix itself. The movie is already old now and the scenario lacks inspiration.
There is one really tough question though; "How should be this crisis handled?"
Well, I don't know the quick answer to this question, but the past teaches that the only way someone should not go is "Yet Another War".
But different ones. They are coming from above. Maybe is black magic and voodoo.
So, yesterday I was coming down the stairs in the office when -snap!- a pain in my upper back left me short of breath, sweating and getting dizzy because of pain.
It was so intense that I couldn't even explain to other people looking at me what happened.
After a nice massage from this guy on top of an office desk, I was really better and I could walk again - we also took a video of it ;-).
I had a nice evening-night out with a very close person of mine in Chiswick High Road, our favourite place to hang out and I was in a very good mood, until next morning while walking towards Acton Town station, SNAP!
It was even stronger this time. I fell down on the pavement like I had been hit by a bullet. Then I sat on a fence trying to breathe, but at a point I got dizzy and almost fainted. I cannot really remember, everything went purple-black.
I walked back home really short of breath and struggling, cursing my landlord about the cheap ass mattress he bought for the house and also blaming myself for not buying a proper one in the first place.
What I realised though, is how much even more antisocial I can get when I am in pain.
Crowdy places like buses become a nightmare. Even though people respect you and your personal space in this country, there is always a douchebag that will push you.
Also, I should take a picture of myself at work, I sit exactly like these ergonomic stickers suggest you to:
I hope this thing goes away after the weekend, otherwise I will have to pay a visit to my General Practitioner.
I like Java a lot. It is a very safe, consistent language that protects you from shooting yourself in the leg. It also has a variety of very good libraries and makes it very easy to produce javadoc for your code. Also, if you really follow Java's standards, your code should be self documenting (at least for the particularly easy parts).
But what is annoying for me many times, is the boiler-plate code that sometimes is necessary to be written, along with the lack of pointers.
Before any "Java Developer" lashes out shouting that in Java everything is a pointer, I will step up and say: "I know, and this only makes matters worse".
I've written plenty of code in C and I know how easy it is to mess up your code with pointers. Though, I believe that 5% of the tasks MUST be implemented with pointers, otherwise you end up writing pages of code and refactoring, swearing and remembering good ole' pointers.
I also know that if you know how to use them properly, they are one of the most powerful tools a developer can have in his toolbox.
Apart from that, I tend to agree with Joel and a lot of other guys who say that "one that did not cope with SEGFAULT, pointer arithmetics, recursion" is NOT a real programmer.
Because, even if you don't have them in Java and a lot of other "softcore languages" you can figure out the weirdest bugs that happen in the lower levels of code, "closer to the machine".
After twitter disabled access to tweets from apps without using oAuth and registering the app in dev.twitter.com (API v1 was retired on June 11th 2013), a lot of the Joomla plug-ins out there were failing miserably - they weren't using oAuth in order to be simpler to set up.
It works like a charm, maybe I'll hack a bit its design because it's not the prettiest thing in the world though.
Microfeed is proudly powered by Microfeed. MicrofeedCeption.