Pages

Wednesday, September 28, 2011

android apps

Smartphones are for everybody nowadays.  Everything is accessible from your phone: email, IM, youtube, facebook, twitter, you name it.

My personal favorites are the android phones. There are tones of apps available to an android phone user. These applications are available among other sites on the android market.

I recently discovered that there is an even simpler way to install apps from the android market on my phone. It's possible to search for the app on your computer and click install. If you are logged into google, it will automatically send you application to your phone. Pretty neat, isn't it?

Maybe you would think about the security implications of this, but I prefer not to get into this. In my opinion privacy and security are long gone. Believing that there is privacy online is quite naive. But as long as I'm not a spy and I know that people won't get out of their way to find out where I am and what I do, I really don't care. I prefer to enjoy these cool features that make our life easy and pleasant.

Tuesday, September 13, 2011

add disk to lvm


Suppose the Disk is /dev/sdb, the second scsi disk,

  fdisk /dev/sdb
  create as many partitions as you need using command n
  Label them with command t as 8e for making it Linux LVM
  Write and Exit with the command w.

Format the partitions you require using mkfs command

  mkfs -t ext3 -c /dev/sdb1

LVM commands

  pvcreate /dev/sdb1
  vgextend VolGroup00 /dev/sdb1
  lvextend -L 15G /dev/VolGroup00/LogVol00 ;for extending LogVol to 15GB
  lvextend -L+1G /dev/VolGroup00/LogVol00 ;for adding one more GB to Logical Volume LogVol01
  resize2fs /dev/VolGroup00/LogVol00 ;for resizing the Logical Volumes

To increase the storage capacity while keeping the server online, add the disk and then rescan scsi:  

echo "- - -" > /sys/class/scsi_host/host0/scan

Monday, September 12, 2011

control cron from puppet

There is a nice way to control crontab from puppet. An example:


        cron { do_smt:
                command  => "/root/do_smt.sh",
                user     => root,
                hour     => 17,
                minute   => 30,
                monthday => '1-7',
                weekday  => 'Sat',
                month    => [1, 3, 5, 7, 9, 11],
        }

This would lead to a cron entry like this:

# HEADER: This file was autogenerated at Thu Sep 01 20:31:35 +0900 2011 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: do_smt
30 17 1-7 1,3,5,7,9,11 6 /root/do_smt.sh

For a complete reference to all the puppet cron type's attributes, check the puppet documentation site.

Saturday, September 3, 2011

vacation highlights

I was in vacation this summer. I almost forgot about it already, so I think it's a good idea to make a post about it, it might help remember.

The Lost World (lumea pierduta) - Padis Mountains


The atmosphere there is very strange, the woods are quiet and deserted. The silence is overwhelming.

The old railroad (Mocanita) - Viseu, Maramures County:







And finally, me in vacation mood, heading to Bohodei waterfall, maybe longest waterfall in Romania (?):





Wednesday, August 31, 2011

miscelanious

First of all, today is a very good friend's birthday, so: Happy Birthday, Maria!

There were some interesting news I read today. One of the was about Pakistan banning secure VPN connections. The reason is of course that it would be difficult if not impossible to monitor this kind of connections. I guess people from Pakistan are not allowed to have privacy, at least not over the internet. Maybe tomorrow they will ban the internet itself. All I have to say about this is that this year was not a very good one for the Arabian dictatorships. Think about Egipt, Libia, now I guess things are happening in Siria also. Usually nothing good comes from very strict laws. Except for China of course. They really made it work.

Another interesting topic: e women bought a laptop for the fabulous sum of 60 dollars. Big surprise, this laptop proved to be stolen. Since these days there are all kind of software that will help you locate you missing laptop, the laptop was found and recovered. In the meanwhile it happened that this woman's boyfriend was abroad. She then took some pictures of her naked and used the laptop to send them to the travelling boyfriend. Now she is requesting these pictures, because she says that they are her property, even tough they are located on a stolen property. I have no comment on this topic, but I just find the story quite funny.

This is it for today. Have a good one!

Friday, August 26, 2011

apache vulnerability

All versions of apache web server have a very serious vulnerability. Only a perl script that runs only one computer will crash any web server. This is described well enough here: http://seclists.org/fulldisclosure/2011/Aug/176

The script that crashes Apache is called killapache.pl and is all over the internet, for example http://pastebin.com/EYFUnFRz

Everyone out there having a webserver should protect it against this script. There are all kind of solutions on the web, I personally searched for one that would work on Centos. I created a file called fix-ddos.conf and placed it in /etc/httpd/conf.d. This file contains:

    SetEnvIf Range (,.*?){5,} bad-range=1
    RequestHeader unset Range

For Ubuntu it was enough to add to apache.conf the two lines:
     SetEnvIf Range (,.*?){5,} bad-range=1
     RequestHeader unset Range

There are some other proposed solutions, but I only tested successfully the two I mentioned. Other solutions and further information are available here: http://www.dslreports.com/forum/r26243047-Apache-1.x-2.x-Range-header-security-issue

Friday, July 8, 2011

google+

google+ is the new social network from google. It's in a state the call "field trial", a fancy name for a beta. People talk a lot about this new network. Everybody is impressed, looking forward. Even those who never heard about this before, maybe you noticed the +1 option that appeared in google searches a few days ago. Maybe you noticed the minor changes in the search interface.

I have some feelings about this upcoming google product. This will probably be a revolution in social networking. Let's see: take google's search engine, add gmail, add picassa, add google reader, add all the search results and all the google searches you ever made. For example: you are probably logged into gmail while making your google search. This means google knows what you are interested in. Then we will give then our friend, interests, pictures, everything. It will be a lot of fun, I bet, but in the end, google will know each one of us better then our own mothers do.

Just think about how much power does one have with such an amount of information. Then  think one step ahead: that information in the wrong hands. IT is fun, social networking are fun, but we should be aware of where the things could go wrong. I don't think there is any point in avoiding these network, it won't help, it won't because probably you will not be able to avoid them entirely. So what if you don't upload your pictures to facebook or picassa? Probably your friends will. My conclusion: no point in avoiding these "evils", but we'd better be prepared for the worse. Make worst case scenarios, think big, then maybe there is a chance the impact will not be so harsh.

PS: I just my google+ account today!

Wednesday, June 29, 2011

back

It's been quite a while since my last post. Even I felt sometimes that this blog is an abandoned project. I thought and I thought about it. I will not abandon it. It is the least I can do. Share some opinions, write stuff down. Even if nobody would read, at least I would be able to see what was I like some time ago.

These are the things were going on lately: weekdays migrating email to google apps, various other projects; weekends at the cabin in the mountains I try to build. Not with my bare hands, like Chuck Norris would make it. And I also have to admit that I have help, a lot of help.

There are quite a lot of things going on in the IT business at this point. I start to see the need of elastic capacity growing. I believe this is the future. Scripting, automating, elastic capacity. At OS layer, would be nice at network layer also. A very strong candidate for a custom cloud solution is Open Stack. I made a purpose to check that out how it would work for us. Also, Vmware could play such a role if we use the VIX API. I will try this solution also and see what comes out of it.

On the other pole of my existence there is the construction. I will make a post with some pictures of the surroundings and of the fabulous construction. There are still a lot of things to do, a lot more then I thought about before all this shebang started. I will get back to you on that.

Anyways, just wanted to let everybody know (myself included) that this blog is not dead. I am back!

Tuesday, March 22, 2011

romanians

Today I feel angry and a bit frustrated. The news are aggressive. Earthquakes, nuclear power plant gone all wrong, brand new war. It's quite much to digest if you are a person aware of the surroundings.
I truly believe words are not capable of expressing my admiration for the Japanese people.  Just think which other country would be so disciplined? Who would stand in line quietly, calmly in such earth shattering situation? I analyzed the situation a bit, imagined all this happening somewhere else, in random locations. My conclusion is that Japan is in another league. Their "kung fu" is better then everybody else's.

And then here comes Romania. Adrian Severin was external affairs minister a few years ago. While having  that position, he expressed his concern that the water in Romania has two molecules of hydrogen and only one of oxygen. He suggested that people stop drinking the hydrogenated water. After a silent period, Adrian Severin strikes again. He is convinced by some British reporters disguised as lobbyists  to amend a European law in exchange of a certain amount of money. Another member of the European Parliament who is in the same situation as him resigned his position. But Mr. Adrian Severin did not consider that a good course of action. There are just facts, no comments from my part, everybody is free to draw its own conclusions.
Romania: hospitals are closing down because of the lack of money. Doctors leave the country because it's almost impossible to live with 150 euros a month. Workers leave the country. Everybody leaves the country. The pattern is that they come back after a while. When they have some money. I keep wondering: why is it so difficult to make something here? I sometimes miss to see the logic in what is happening around us. The law is different for different people. The values that are promoted here in Romania seem to be all false and empty. We promote extremists, good looking women that are close to our president (daughter and.. ), priests that used to work for Ceausescu's security (the new Cluj Mitropolit), mayors that have never seen a grammar book. 
It is said that each country deserves it's leaders. I am quite certain that is true. I just wonder: is there anything to be done? Or maybe leave the country? How is it possible to have the mentality that we have and leave in the same era as the Japanese? Why can't we learn just a little bit? I would like to see progress. A little progress would be nice.

Tuesday, March 8, 2011

8 March - 100 years anniversary

What does 8th of March mean? Is it Mother's Day? Is it a day celebrating all the women?

I was wondering today (8th of March) what is all this about? Why the flowers? Why the greetings? I searched a bit and I found out that this is the 100 anniversary of the International Women's Days. It started as something political. In 1910 a congress of the European socialists parties decided that there should be such a day. Actually the first IWD (International Women's Day) was celebrated on 19 March 1911.
Interesting enough, the manifestations for this day was considered the start of the russian soviet revolution in 1917, yes, the great Bolshevik revolution.

As an ending: I wonder why women in Romania start senteces with: "I'm not a feminist, but...". Is it that bad to be a feminist? I personally believe it isn't. If there were no feminists at all, women would still not have the right to vote or to work, let alone to wear pants. Maybe there are still some things that are wrong and can be fixed. Maybe there is still use for feminists.

Happy anniversary to all the women! Happy anniversary to all the feminists!

Monday, March 7, 2011

centos upgrade issue

When trying to upgrade from CentOS 4.4 to 4.8 I had this error:

159 Header V3 DSA signature: BAD, key ID

I seems the rpm database was broken. To fix it, do:

mv /var/lib/rpm/Pubkeys /var/lib/rpm/Pubkeys.old
mv /usr/lib/rpmdb/i386-redhat-linux/CentOS/Pubkeys /usr/lib/rpmdb/i386-redhat-linux/CentOS/Pubkeys.old

rpm --rebuilddb -vv

This did it an I was able to make my upgrade.

Sunday, February 20, 2011

sudoers

If you want to allow a user to run a command as another user, /etc/sudoers file should be used. Usually it's necessary for a user to run a command as root, equivalent to the Windows "Run as administrator". That is quite straight forward. Add in /etc/sudoers:

username ALL=NOPASSWD: /usr/sbin/ntpdate

Now this will be allowed:

username@laptop:~$ sudo /usr/sbin/ntpdate

There is another situation: when you need user1 to run a command as user2. For this you add to /etc/sudoers:

user1 ALL=(user2) NOPASSWD: /home/user1/bin/start_daemon

In this case user1 will be able to do:

user1@laptop:~$ sudo -u user1  /home/user1/bin/start_daemon

Tuesday, February 15, 2011

grow meat

I recently read an article about some scientists that work in a lab and study ways to artificially grow meat. They are complaining about the lack of funding. Also they are complaining about people not being receptive at what they are doing. People tend to reject the idea of growing meat in a lab.
I wonder why that is so. What makes people prefer overdosed chicken which grow in those small small boxes in the modern days farms? I guess there are remains of the idilic picture of the farm where chicken run free around the house. But how many of us eat chicken that has ever seen the sun? What is the difference between growing meat in a lab and growing something that resembles only by very far with the chicken we know?
I believe there is conservative part in us. A part that denies changes. If we consider our history, each change was more or less painful. The same history proves that changes seldom can be actually stopped. I might seem like the devil's advocate here, but I say: we should start realising the true picture of the present. There is very little left that we can consider natural or organic. This is very bad. We eat a lot of junk. We drink a lot of junk. The lucky ones that have the money go out there and by organic stuff. As if they have any warranty that the thing they spend a fortune on is organic.
Anyways. I don't believe there is enough organic food for everybody. This solution is no longer a solution for us. Not a solution for us as a population of this planet. The sooner we realise this, the better.
There are solutions like this: grow meat in a lab. Why not? Maybe it's healthier than those chicken I talked about, you know which. Those chicken that are like dinosaurs judging from their breast. Why not invest in an alternative to conventional nourishment? Maybe if we invest some money and some interest in these alternatives we will have something to win in the long run. I also think about applications of this meat-growing thing in medicine. What is, let's say you lose an arm. And then somebody grows in a lab an arm for you. After all, maybe we'll also find a way to grow bones, if we manage with the meat part. I wonder how many of you would refuse that hand. Because it's not organic.
My position is this: let's try to make good food. Let's stop trying to fool people that we offer them organic food. I am sure that given enough resources, people will find a way to make healthy and good artificial food. Grown in a lab. I would prefer it to what we have now. I would like to eat some proteins, fibres, glucoses that don't also contain pesticides, that don't also contain growth hormones.
I wonder how much time it will take for all this to change. I wonder in how many years, decades, centuries people will stop trying to eat organic food. But I believe that time will come some day. And then, there will be other problems, of course.

Monday, January 31, 2011

git hooks

git comes by default with a number of hooks. Hooks are little scripts you can place in $GIT_DIR/hooks directory to trigger action at certain points. When git init is run, a handful of example hooks are copied into the hooks directory of the new repository, but by default they are all disabled.
It's good to know that each hook that has execution rights, will indeed get executed. If you have an executable hook by mistake you can end up with this error:

lvarga@lvarga-desktop:~$ git push origin master
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 455 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
*** Project description file hasn't been set
error: hooks/update exited with error code 1
error: hook declined to update refs/heads/master
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://gitserver/var/www/git/repo.git'

This happened after I changed the permissions of the hooks. I was only using the post-receive hook, all the others were default. I gave all of them execution rights and then I had quite a hard time understanding why some empty hooks were executed.
Then googled a bit and found that the permissions are the problem. It went away after I took out the execution right of all the hooks I didn't use

Thursday, January 27, 2011

late is good - how statistics can be deceiving

I read today an article which said that we (Romania) have the fastest internet connection in Europe. Of course this article was in a Romanian online newspaper. For the article see this. The I made some research to see if this is true and what are the explanations of Romania ranking first in this top, I have to admit it rarely does when being first is something positive.
First of all I searched some international tops. Romania was in the 4th place in the world and 3rd in Europe. Not the first, but good enough anyway. South Korea is the first, then Lithuania and Latvia. For the entire top, check this out. Seeing these countries in the top made me search further.
Then I found the reason, the explanation behind these figures: internet connections became available in Romania later then in more developed countries. This meant that the technology first used was newer and better. Until now it all sounds good: we are faster, newer, better. And then: there is another sexy thing called internet penetration rate. This show which is the percent of a country's population that has internet access. I found a top listing the first 58 countries in the world here, but Romania is not present in this top.
So, all in all, we have something, that's true. We have broadband internet connections, modern equipment. But still we are behind. We are behind because our infrastructure is covering only around 30% of our country. This is just an example how figures and statics can be somehow deceiving, how you should look further into an issue before having an opinion, before being proud or sad or whatever. Information is out there, just grab it!

Tuesday, January 25, 2011

linux restricted user

I was using scponly for creating restricted users, but I found that setup quite complicated to use, so I was searching for an alternative. I found rssh, which was much simpler:

[root@zion ~]# yum install rssh 
[root@zion ~]# adduser -g rsshusers myuser

Edit /etc/passwd:

myuser:x:513:109::/home/myuser:/usr/bin/rssh

For configuring rssh, see /etc/rssh.conf. You can:


allowscp
#allowsftp
#allowcvs
#allowrdist
#allowrsync

Also, you can configure chroot for the restricted user if you want. So, it's quite simple to setup, simple to use.

Thursday, January 20, 2011

gone bad

I was reading the other day one interesting article. It was about a sysadmin that went bad, really bad: he was working for a quite large online retail company, but he also had a small company of his own. He used his small company to sell his employer pirated software for an amount of several hundred thousands dollars.
When BSA checked the company, they had a big surprise. This made them call some consultants, because they feared to confront their sysadmin. He had all the passwords, he had control over their hole infrastructure and they were afraid of him holding it as a hostage. The consultants also discovered that the company servers were hosting a medium-sized porn site. And, there is more: the sysadmin had a list of credit card details of several hundred of the retailer's client.
Of course this is a situation. After the consultants analysed and assessed the situation, their plan was the following: they came up with a reason to send the sysadmin to the other coast. This way, they assured that they had a window of opportunity to reset all the passwords during the sysadmin's flight. After they did this the bad guy got fired, of course.
Happy ending. But is it? How long is to long to have such a person working for you and not noticing that something is wrong? How long is it ok for an online reseller to host a porn site? And many other questions like this..
I always like to consider the worst case scenario when I make an assessment and take a decision. I wouldn't want to have a fight with my sysadmin. I would keep him happy and if necessary make a clean break-up and remain friends. It's not a good idea to have a fight with your car's mechanic. Maybe you find yourself without brakes or a wheels fells off.
Anyway, I really don't agree with the things this man did. It's just not right. But we all have to realise what are the possibilities, what could happen. This is a funny story to tell. But I bet no one would feel that good in the retailer's shoes.
And I continued reading about this kind of stories. I feel that there is a simple cause for all these kind of incidents: management fails to see people. They only see and manage resources. You can handle resources quite easy. There are no feeling, resources don't get angry and don't want revenge. Equations seem simple: you want the best security, you buy the best product. Well, if you don't see the people, you might get hurt, no matter how much you pay for your security products.

Saturday, January 8, 2011

Ubuntu can be negative!


Negative
The Negative plugin provides immediate, high-contrast windows for the visually impaired by inverting the colors of individual windows, or all windows at once.

    * To enable or disable Negative on the focused window, press Super+n.
    * To enable or disable Negative on the screen, press Super+m.


Of course this happened by mistake and I had to search for a way to revert it. Great things come out of mistakes.

Thursday, January 6, 2011

(do) things own us (?)

I remember when I was a bit younger. Money was not all that important for me. I mean, ok, if I had any I would be happy, spend then, end of story. If I didn't have the money, it was not such a big deal.
These days I caught myself thinking what would happen if I had no more money and at first I thought it's something really bad. Then I started comparing my situation now with my own situation a while ago, when I didn't care about this. What is the difference? I guess back then I had nothing to lose. I had nothing of my own. I was living with my parents, loaning their car when I needed one, eating from the fridge and so on. This is a pretty happy and careless life, I guess everybody could agree.
And now.. now it seems that I have more: a car of my own, a place to live, a fridge which occasionally becomes empty if there is no refill. Anyway, you know, everything from the movies: "Choose life. Choose a job. Choose a career. Choose a family. Choose a fucking big television, Choose washing machines, cars, compact disc players".
Ok, so I have all these but now I worry that maybe someday I would not have enough money. Enough money for what?
After careful deliberation the verdict is the following: I would not have money to buy gas for the car, to repair it, to fill the fridge, to pay for electricity for that TV and so on. All the things I own get back to me. It's like a revenge of the undead, the revenge of the things I own against myself. I started to think that actually these things own me, not the other way around. They don't have to go to work every day to earn money for me, instead I end up waking up each morning.
The solution to this problem was presented in a movie some time ago. If you blow everything up, then the problem is gone. Then you can start your own secret club where people meet to beat each other up. And you get to make up stupid rules like: "The first rule of Fight Club is: you do not talk about Fight Club".

Tuesday, January 4, 2011

Life/Tech

I sometimes wonder where technology ends and life starts. But this is a question that you could ask some time ago. I don't think that we still have a line between technology and our daily life. Maybe we have but it moves constantly and there is less and less of anything that has no connections or interactions with technology.

I am trying to lose some weight so I went on the android market and searched for some software that helps me do that (as if any software could do that.. yes, I know). I found there some pretty neat applications: one that graphs your weight over time (Weigh Weight LITE  ). Another one that uses the phone's gps, google maps and your selection of the activity to draw your track, compute the consumed calories and of course upload these on the web. Maybe even on facebook, so you can share these statistics and results with your friends. The second application is called  runtastic  This application can also do geotagging using the photos you make while working out. Of course I also found a WI-FI body scale that also uploads infos on the web. And of course this could go on and on.

 I have the feeling that the thing we call web is spreading very fast and it takes control of everything we do. And it's quite difficult to keep your perpective in the process. Ah.. I forgot to mention about the fridge which has a linux OS. This first came as a joke here but who can tell where the joke ends and reality will take place? 

My point was to show how our life is getting more and more connected each day. There will be a day when we will see facebook as a necessity. History and evolution is very interesting. I can only wonder when I remember that I first used ms dos and now I am in the middle of all this tech frenzy.

Monday, January 3, 2011

puppet addon for vim

There is an addon to puppet which enalbes syntax highlighting of the *.pp files. To install this addon on ubuntu:
sudo apt-get install vim-puppet
The addon is installed, but you still need to enable it. For this you use the vim addon manager:
vim-addons install puppet