Feb 15 2017

Win some, lose some

Category: MiscellaneousIuliana @ 22:48

Writing in English on this blog has its advantages. The first advantage is that I can reach a wider public.  The second is that my knowledge of the English language is improving.(I hope). The third advantage is that friends of other nationalities can also read me and have a feeling of keeping in touch with me.

The disadvantage of all this is that MySQL crashes more often, as more readers, under the hood means more connections to the database. And thus, the memory leaks of such a competent software kinda make the memory insufficient for the said software to run.  I know, I know I have to learn how to configure it better. But guys, I’m not a MySQL Administration savy, and I do not have the time right now to become one either.

So what did I do? The easiest thing, I used something I know: Linux and bash scripting. I created a cron job to restart MySQL every two weeks. I can only hope my script will stop and start the service, before it kills itself because of the memory leaks.

But, just in case,  here it goes: I am asking for help. This blog is hosted on Ec2 micro machine. If you have a smart configuration for MySQL that will make my cron job useless, please send it to me via email, or just put it here in a comment so me and other busy part-time bloggers like me will put it to good use.

Stay safe, stay happy!

Tags: , ,


Aug 26 2014

Setting up a PPPOE connection in Fedora 20

Category: TechnicalIuliana @ 11:21

I just moved to a new city and yesterday an internet provider representative came to visit to set up my internet access. Until singing with this provider I was never concerned with the type of internet connection I had. Also, always being behind a server/router made sure I would never bothered with this. But I remember my friends which had internet from the same ISP, they had to set up on Windows something called an PPPOE connection and an username and password was required.

I did not realized that I will be needing that type of connection too until the ISP representative was here the previous evening, so while he was finishing the papers I searched on my mobile how to do that on Fedora. Apparently it is quite easy but there are a few catches, so even if you find the instructions easily on Google I will be writing about it here, just in case anybody else needs to know this. (This will be most useful for Linux Romanian beginners which want to sign up with the RDS ISP and have dynamic IPs)

The command to set up a PPPOE connection is pppoe-setup. To use it you need to be root. So open a terminal and log in with the root user. Then execute that command and step by step you will be requested the following:

  • Login name: [insert the username provided by your ISP]
  • Interface: [insert here the name associated to your network adapter, usually it is eth0 so you can go ahead and just press <Enter> to use the default, but in some cases like mine, you have to open another terminal and check your network adapter name using the ifconfig command – in my case the network adapter is called p2p1]
  • Demand activate the link: you will see some text explaining the options you have, the paragraph starts with “Do you want the link to come up on demand, or stay up continuously?” and the default option is for this link is not to be activated on demand. In case of a  dynamic IP you would preffer for your link to stay up permanently, so you will insert  no.
  • IP address of your ISP’s primary DNS server: [this is the tricky one, most people just hti <Enter> and go with default, but in case of a dynamic IP which will be provided by a server so the option you need so insert is server ]
  • Password: [insert here the password provided by your ISP, you will be asked to introduce it twice]
  • USERCTRL:[insert yes, to give access to the normal user to use the connection]
  • FIREWALLING:[you have three options here, but you have Linux and a dynamic IP so you do not need a firewall –  insert 0]

The very best thing about the pppoe-setup is that every option you have comes up with a complete explanation on what it means, so all you need to know basically is the name of that command, everythign else you can read while setting up the configuration. After inserting all necessary data, you will be told how to start, stop or view the status of your connection

Congratulations, it should be all set up!

Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'
to bring it down.
Type '/sbin/pppoe-status /etc/sysconfig/network-scripts/ifcfg-ppp0'
to see the link status.

So just do that, execute /sbin/ifup ppp0 and indeed you should be all set up. If you encounter problems, please let me know via comments, I am am always eager to learn new things and I love challenges. :)

Tags: , ,


Apr 13 2013

Linux: connect to VPN (complete)

Category: English posts,TechnicalIuliana @ 22:53

Some time ago at work, I was assigned to a new project. To be able to access client specific resources I needed to be able to connect to a VPN. I was given a domain, username, password and a gateway. All was simple in Windows and all resources were accessible. Among these resources there were some servers (testing, acceptance, stuff like that)  which had the application installed and were accessed through the browser via http. (Example: http://server1:8080/application). But when my request to work on Linux was approved, and I received a fresh Linux workstation to configure as I please, I stumbled across a few problems, because any tutorial on the internet  that explains to you how to set up a VPN connection in Linux is incomplete. So, what did I do?

The first step was to  get all the information from Windows that I could. So I clicked right on the VPN connection and made print-screens of all the properties  shown. Then I logged on to my Linux (Fedora 18 at work, Ubuntu 12.10 at home – I am mentioning this because the steps are identical) and proceeded to create my VPN connection according to the steps here, but always taking a look at the print-screens I took in Windows.  Just to make sure, I also asked my colleague who gave me the VPN details in the first place what type of VPN was it and he said:  “ it’s standard Windows VPN, PPTP. Port 1723″

So the steps I took were:

  1. Click right on Network Connections icon , select  VPN Connections, then click on Configure VPN
  2. In the dialogue window that appeared I clicked on the Add button
  3. A new dialogue window appeared asking me to select the type of the VPN connection. I selected PPTP and clicked on the Create… button.
  4. A new dialogue window appeared with two tabs: VPN and IPv4 Settings
  5. In the VPN tab there was an Advanced button. When clicked a new dialogue window appeared with advanced options to select. I checked everything that I found checked in the Windows print-screens and left unchecked everything that was unchecked in them. In my case I had to deselect all authentication methods but MSCHAPv2 and check everything else in the dialogue box except “Send PPP echo packets”.
  6. And now if you save everything, the connection will succeed. But if you need access to some application installed on some servers accessed via their host names, you will need something called DNS suffix which can be added in the “Additional search domains” textbox in the IPv4 tab.
  7. If you don’t know what value to put there, and your colleagues didn’t tell you,(mine did not) you can do the following. Log into Windows and  connect to the VPN.
  8. Open a Command Prompt terminal and execute the following command: nslookup hostname You should get an output similar to this:
  9.             Server:  hostname.somedomain
                Address:  xxx.xxx.xxx.xxx
               
  10. Now, copy somedomain in the IPv4 tab, in the “Additional search domains” textbox and save everything.
  11. If you need the same kind of access I needed, also take a look in Firefox and the proxy it uses. Even if I had a successful VPN connection and a correct DNS suffix, I could not connect to http://server1:8080/application because my Firefox was set by default to “Use system proxy settings“. When I set it to “Auto-detect proxy settings for this network” it worked like a charm.

So, these are the steps that I took. I asked a Linux guru friend (Rpx) for help in debugging the VPN settings, because I am not that good at networking and I thought the additional information I discovered with his help, might be useful to somebody else too and that’s why I wrote this post. I will appreciate any kind of feedback.

Tags: , , ,


Dec 07 2012

Compiling, compiling … done.

Category: English posts,TechnicalIuliana @ 14:13

As you noticed from my previous post, a few days ago I started updating a Gentoo VitrtualBox machine.
Right after the update used:
#emerge -av –depclean
And
#revdep-rebuild

And that’s when all went to hell. Apparently a lot of my packages were considered unnecessary and were unmerged. Among them some dependencies for the VirtualBox modules which made my virtual machine forget about the graphical interface. The possibility of displaying a log on the five inch window to see what the problem was , was not an option so the first step was to fix the system a little so that I could at least have access to a bigger screen.

The solution was simple in my case, just emerge –sync and emerge world again . And surprise!! a new version of Kde was available, 4.9.4 and the system proceeded to installing it. So I said, what the hell let it do it! After a few hours of torture, during which I searched for a solution to make the VirtualBox modules work in order to be able to make my virtual machine interact friendly with the underlying OS, a Windows 7, I found a guy on a forum which had a similar problem and his solution was to upgrade the kernel. So I checked the version of kernel I was using. Indeed was an old one. A new one was not such a bad idea. So I downloaded the new sources and got to work taking the same steps specified by the manual. By the end of the night I had a fresh 3.5.7 kernel and the same problem with the VirtualBox modules. I unmerged them (virtualbox-guest-additions and virtualbox-modules), emerged them again. But the situation was the same. I was going out of my mind, not knowing what the problem was. So at the end of my patience, I asked an expert: Rpx. Based on a piece of message found in a log file in /var/log “vbox disagrees about version of symbol module_layout”, he concluded that my VirtualBox modules were compiled with a different kernel dependency. Well, that’s was all I needed.

I wend on and recompiled the kernel using:
#genkernel –menuconfig –bootloader=grub all
And when configuring it I took a look here and selected the options recommended for a VirtualBox machine. The kernel was compiled, I just unmerged and remerged the virtualbox stuff and instead of following the steps in the previous link I just followed the instructions displayed in the console at the end of the compilation for virtualbox-guest-additions.

I restarted the system and… voila! My virtual machine is up and running and interacting with Windows just fine.

Disclaimer:This is not a tutorial on how to fix a Gentoo VirtualBox Machine, it is just a post in which I brag about the fact that I can do it. :D You could take it as an advice to Read The Fucking Manual!, because that’s what helped me in the end.

Tags: , , ,


Dec 05 2012

Emerge kinfocenter-4.9.3 fails [Simple Solution]

Category: English posts,TechnicalIuliana @ 12:31

A few weeks ago I switched back to Linux at home, because the training for the Spring Certification exam ended (setting up the official working environment on Linux was a pain, that’s why I worked on Windows for a while). At home I have SolusOS, which takes care by himself of updates and stuff( I chose because it was more suited for a laptop). Switching back to Linux at home, made me fell like working on Linux at work too, so I remembered I had a VirtualBox machine with Gentoo on it. So I started it and begin updating it, because the poor thing was not used in a while, so this process was unavoidable.

I intended to run the basic command for updating a Gentoo system, as recommended on their official site:

# emerge --update --deep --newuse world
# emerge --depclean
# revdep-rebuild

Unfortunately it was not so easy, because I have stumbled across this problem. So kinfocenter-4.9.3 failed to compile and the problem was a missing library, obviously, but the log message was not very clear. I have to mention that when it comes to Linux I am not such a guru, so after trying the solution on the forum and failing miserably, I stared trying anything just to make this work.

The problem was obviously with the media-libs/mesa library. I had the 9.0 version installed already and as I figured from the forum topic kinfocenter-4.9.3 depended on mesa-8.0.4-r1. Apparently the solution was simple, just unmerge the current version and install the required one, the old one.  Which I did, meaning I unmerged mesa-9.0. And after doing that, I had an idea.

What  if I used revdep-rebuild? Because that’s what the manual says it does:

revdep-rebuild scans libraries and binaries for missing shared library
dependencies and attempts to fix them by re-emerging those broken bina-
ries and shared libraries. It is useful when an upgraded package
breaks other software packages that are dependent upon the upgraded
package.

And I used it. And it worked, kinfocenter-4.9.3 was installed successfully and is working fine with mesa 9.0 which was automatically installed by revdep-rebuild. :|  So my solution to fix this is made of two steps:

# emerge --unmerge media-libs/mesa
# revdep-rebuild

After revdep-rebuild finished I continued with the update of the system, and so far all is working great.

Sometimes it’s better not to be a guru in a specific domain, because it gives you the opportunity to find new and simple solutions.

Tags: , , , , ,


Jun 19 2012

when you have an itch…

Category: English posts,TechnicalIuliana @ 10:34

… you gotta scratch it. And I had a serious itch cause by my Windows. Even if Windows has evolved so much, even if Windows 7 is the peak of greatness among all the Windowses before it, it still does not know how to manage 4 core processors. So I was seriously pissed about the fact that Windows 7 froze from time to time, making my super-laptop look like my first computer, an AMD K6, 500 MHz and 256 MB SRAM. Which was definitely not cool, considering the fact that my laptop’s configuration looks like this: Intel Quad Core i5-450M and 6 GB DDR3. The only reason I kept windows so far on my laptop was that my processor has a capability known as turbo boost, meaning that can over-clock itself when needed. But this won’t be needed that much if the tasks were efficiently distributed between the 4 cores, which were not.

So two days ago, I just snapped, decided to give up the possibility of playing games for a while and went on a search for the perfect Linux for my laptop. I am fond of Gentoo as you know, but compiling a full OS was not an option because it is a time-consuming operation and also because all that compiling would set my laptop on fire and it’s already hot in Romania right now (32 Celsius degrees). So I was left to choose between Archlinux and Mint. I did not even consider Ubuntu, it’s a Linux that looks and acts like Windows, the thing I was trying to get rid of. I had Archlinux before and I know in order to get the final result some time must be wasted on its configuration, so I went for Mint.

In less than 30 minutes I had a fully functional and compact Linux, oh well … fully for a normal user, not for me, a curios developer. So after this I went on and started installing the development software. The first one I wanted to install was the jdk. Mint uses open-jdk which Idea and STS refuse to go along with, so I went on a quest for installing the Oracle version. If on other Linux systems this was a piece of cake on Mint, it was not so, because Mint has all these symlinks pointing to open-jdk binaries, and even if you do everything right, set the JAVA_Home variable and add it to the path, when you will execute “java -version” in the console, the binary that will be executed will still be the one of the in the open-jdk. The only way to change this is to go to /usr/bin, see where the specific symlinks point to and change that. After that I installed Idea and STS and everything was flawless.

Then I wanted to add a second monitor and this is where all blew up in my face. But not because there was something wrong with Mint, but because one of the cables was not plugged in correctly in my monitor and the system did not see it. I did not even consider that the problem might come from a cable and went on and tried to install nVidia drivers in order to convince the system to see my external monitor. After the first restart I was left without an interface, because the nVidia drivers were not stable, ofcourse. So I went old-school and installed lynx, a text based browser, and searched for a solution for my problem. I did so and tried different options for an hour, when finally it worked and I had my graphic interface back, but the external monitor still was invisible to Mint, so I considered the possibility of the monitor not actually being plugged in the laptop. I check the cables and … surprise. It detected it right away.

Conclusion: if you want to install a Linux on your laptop, I truly recommend Mint, it is small, smart, fast and it knows how to work the special buttons on your laptop, without any additional settings. And is also easy to install, if you are not an old-school developer who considers problems being caused by the software first :D , that is. :)

Tags: , , , ,


Mar 01 2011

Oracle Glassfish v3 update one-liner

Category: English posts,TechnicalRpx @ 14:56

The quick and easy way to update your Glassfish installation using just one command:

Go to the bin directory of your Glassfish installation and issue

# ./pkg image-update

on linux, or

pkg.bat image-update

on Windows.

It will automatically connect to the Oracle Glassfish repository and update itself with no additional hassle.

Note that on Linux, you will have to run the command as an user with proper write permissions over the Glassfish directory tree or as the root user.

This can also be automated using a cron job or scheduled task.

Tags: , ,