Linux.com

Home Linux Community Community Blogs

Community Blogs



Deploying a Linux based vm from VMware template

Deploying a Linux based virtual machine from a VMware template can be a bit difficult when you don't know the ins and outs, the tiny tweaks. 

In this blog post I'll explain how you can get past the problems that might occur.

Read more... Comment (0)
 

Waiting till motivation (or angels) return.

Hello,

My name is Moma Antero and I live in Oslo/Grønland, Norway.

Gscreendump:
In this spring I created an amazing screenshot taking application. It can also manipulate screenshots, photos and other images. And you can easily add your own image manipulation commands to it.

Read more about Gscreendump v0.2 here:
http://code.google.com/p/gscreendump/

For next version, I plan to add some simple drawing capabilities, text and callouts. GTK's GooCanvas seems to be the right way to implement these features.

But at the moment I have no motivation to do coding at all. I will need to wait till these cloudy spring days turn to warm summer.

I just returned from a 2 weeks trip to Lisboa/Portugal. I also visited some other places north for Lisboa; such as Leiria, Fàtima and Areia Branca.

Areia Branca is located at the cost of Atlantic sea. It has a really nice beach with great (i mean really great) waves for surfing. Those waves were too big for my surfing skills, but I will recommend you to visit the place if you like surfing.  The Youth Hostel (in portuguese lang: Pousada de Juventude) is located at the beach. Areia Branca is otherwise a small local village. ATM it was quiet because the summer season and tourists had not fully started/returned yet.

I also visited Fátima town which is a very religious place because, in 1917, a Holy Angel with a message appeared to three small peasant, shepherd girls.
See: http://i1.no/08ca

Obviously back then, this was the standard method to deliver divine and often guite cryptical messages to the people.

My pray is simple. Give me some motivation to continue coding.

.end of first posting.

 See also: http://www.futuredesktop.org

 

 

Future is Upon Us

Hi all

Blessed linux users

The future is upon us.

Remember Rosetta ?

Remember Linear-b ?

Remember C+ ?

You will.

 

Good luck to all.

Jan Bergmans

 

SSH Tunnel between two machines

Here's another nice and short post about SSH and tunnels

Here's something I did in the past for working through DMZ machines, let me explain this scenario:
Immagine you've an UNIX machine inside a DMZ and you'd like to get some data from another host located inside the dmz green area, you've two options for it:

  1. Make a pinhole in the firewall (bad bad bad)
  2. Create a tunnel from the green area to the host inside the DMZ so the dmz machine can use that tunnel to remote forwarding ports from green machine

Obviously we'll discuss option number two :-)

Let's place an example for a quick and dirty explaination

Protected machine inside the dmz green area (protected) : lets' call it "green"
Machine inside dmz yellow area, used for web services from outside/inside: let's call it "yellow"
Service port to tunnel: 3306 from green to 6033 to yellow.
Yes, I'd like to transport MySQL (everything else works as well) from green to yellow so applications on yellow can normally open the database located on green.
Green also decides when and how to handle and keep the connection in order to preserve its data.

So, what's next ?
Let me assume you can ssh from green to yellow without passwords, you've already exported ssh rsa public/private keys from a machine to another (or maybe it could be a good argument for the next post :-) ), so all you have to do is open a tunnel in this way:

REMOTE_HOST=yellow
REMOTE_PORT=6033
LOCAL_HOST=green
LOCAL_PORT=3306

ssh -2 -f -q -T -N -R $REMOTE_PORT:$LOCAL_HOST:$LOCAL_PORT$REMOTE_HOST &

Issue this command on green machine and you'll have 6033 port opened on yellow, try to use mysql command line utility to open a database on green and see what happens.

Hope it helps someone, I've used it in the past to transport data from a db to another but you can even use for something else: JSON on HTTPD (80) and so on

 

**** UPDATE ****
See SSH Tunnel between two machines (part two) for an automatic script and use it easily
**** ****

 

Cheers

Andrea (Ben) Benini

 

SSH Tunnel between two machines (part two)

Here's a script for using SSH Tunnel between two machines discussed before, this script automates tunnel creation and if you add it in your cron you can even check for existence and restore it when broken, let's see the script first:

#!/bin/bash
# Description : SSH Tunnel between two machines for forwarding remote MySQL port
# Author: Andrea Benini (Ben)
# See configuration for details on ports

# Configuration
REMOTE_HOST=yellow
REMOTE_PORT=6033
LOCAL_HOST=green
LOCAL_PORT=3306

# No changes needed below this line
COMMAND_LINE="ssh -2 -f -q -T -N -R $REMOTE_PORT:$LOCAL_HOST:$LOCAL_PORT $REMOTE_HOST &"
COMMAND_SEARCH=`ps x -o args|grep "^$COMMAND_LINE"`

if [ "$COMMAND_SEARCH" == "" ]; then
echo "Restarting Tunnel to $REMOTE_HOST"
$COMMAND_LINE
exit
fi

The script restarts the tunnel by itself when broken, not active, shutdown or else
You can insert it into cron to check for it every 5 minutes or to enable it at the end of the day (you say "two db sync at 20pm" ? yes it is !)

Edit your cron by inserting:

# every 10 minutes
# check tunnel availability
*/10 * * * * $HOME/cmd/ssh.tunnel.support 1>/dev/null 2>&1

and here it is !

Hope it help someone

Andrea Ben Benini

 

Welcome to my blog

Helllo everebody from far far Russia where wild bears walks onthe street.

I`m glad this site opened and based on Joomla.

And.. I found a bug - I cant write to blog in Opera (almost favourite browser in Russia actually) 

 

testing

i need some space for testing,

while () { print; }

 

no linebreaks, no spaces :-(

does  anybody know how to format code here?

 try this:

while () {

    print;

}

 

 

Optimize Web server with 1 IP Public for many web server IP local By Tukang Nggame

If we have one Ip Public, but our web server more then one. How to configuration with apache webserver ? Tukang Nggame have tips. Follow example network topology :

wbsvr-1,wbsvr-2,etc -----main-server(public)--------client-browser

wbsvr-1 is a local webserver 1, example http://192.168.1.1/tukang-nggame/
wbsvr-2 is a local webserver 2, example http://192.168.1.2/tukangnggame/
main-server(public) is main web server, exh http://www.example.com


In Main Server use Apache web server and Isntall mod proxy-html. This command at console :

#apt-get install libapache2-mod-proxy-html

Enable that module (make link module) with command at console :
 
 #ln -s /etc/apache2/mods-available/proxy_http.load /etc/apache2/mods-enabled/proxy_html.load
 #ln -s /etc/apache2/mods-available/proxy_http.conf /etc/apache2/mods-enabled/proxy_html.conf

Edit configuration /etc/apache2/apache2.conf (main server)


Order Deny,Allow
Allow from All
ProxyPass http://192.168.1.1/tukang-nggame/
ProxyPassReverse   http://192.168.1.1/tukang-nggame/
< /Location >


Order Deny,Allow
Allow from All
ProxyPass http://192.168.1.2/tukangnggame/
ProxyPassReverse   http://192.168.1.2/tukangnggame/
< /Location >

Restart apache server in main server with command at console.
 #/etc/init.d/apache2 restart

 Then browse from client-browser
 http://192.168.1.1/tukang-nggame/ with url http://www.example.com/tukang-nggame/
 http://192.168.1.1/tukangnggame/ with url http://www.example.com/tukangnggame/

Don't forget last url with slash (/).

Bingo !

 

Deleting NewFolder .exe virus

Windows has been evolving over time but what remains is their dedicated support to viruses. Out of the many famous viruses, the NewFolder.exe virus has been there for a very long time and pathetically no antivirus company is able to detect and remove this virus.

 NewFolder.exe is a notorious virus that creeps into your pendrive every time you plug into some public system. This virus can be very tedious to manually delete that too if you have a lot of nested directories. One quick solution to this problem is to plug in the pendrive on a Linux machine and run the following code.

Before I give you the code, I'll explain you how it works. Newfolder.exe virus generally creates an executable with the same name as your parent folder followed by a space and the extension .exe ie. If you have a folder named foo, then the virus creates an executable with the name foo .exe. People do not name normal executables with any space before their file extension. The following command will look for all executables that are having a space followed by .exe and delete them.

NOTE: If you have any valid executable having a space preceding the file extension, this command will delete it too. So make sure that executables of such format are not present in your pendrive.

To delete the virus:

  1. Open Terminal
  2. Navigate to the location where your pendrive is mounted.
  3. Type the following command and press enter

sudo find -iwholename *\ .exe -delete

PS: sudo is required if you have any files with no rw permissions. Most of the files will not require sudo.

 

My Beowulf Cluster - Performance Stats

I recently ran into the idea of building a small beowulf cluster in my home. After some googling and after reading some articles from blogs, I was in a position to create my own beowulf cluster. I clustered my Desktop(Intel Dual Core - 1.6 GHz) and my Laptop(Intel Core 2 Duo 1.83GHz). I spent almost 15 hours figuring how to make my desktop and laptop communicate. After three or four futile attempts, I made these two machines talk to each other and execute programs on them parallelly :D. I'm using MPICH-1 to run parallel programs on both the machines. Both the machines run Ubuntu operating system but the cluster can be configured easily on any other distribution very easily.

I've written a HowTo here - 

I ran a program to calculate the value of PI and find the error of PI from the actual value. The follow are its summary.
Performance Statistics:

---------*Run 1: Laptop alone* ----------

pi is approximately 3.1415926535898224, Error is 0.0000000000000293
wall clock time = 3.753598

-------*Run 2: Laptop + Desktop but with only 1 core enabled in my Desktop*------

pi is approximately 3.1415926535898047, Error is 0.0000000000000115
wall clock time = 2.172729

-------*Run 3: Laptop + Two Cores in Desktop* ----

pi is approximately 3.1415926535898047, Error is 0.0000000000000115
wall clock time = 2.167609

-------------------------------------------------------------

 

Setting Static IP address in Linux

To assign a static IP address, just open the terminal and type the following
sudo ifconfig eth0 your_ip_adddress

Here eth0 is the name of your NIC(Network Interface Card). You need super user privileges to do static IP assignment. Its recommended that the IP you assign is in the range 10.xx.xx.xx or in the range 192.168.xx.xx.


 
Page 126 of 133

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board