Archive

Archive for the ‘Uncategorized’ Category

Install VMware Tools on Debian 7

February 7, 2015 Leave a comment

Before the tools are installed, you must install make and gcc

sudo apt-get install gcc make

VMware tools requires the Linux Kernel headers

sudo apt-get update

sudo apt-get install linux-headers-$(uname -r)

Insert the CD.  Player -> Manage -> Install VMware tools…

Mount the CD

mount /media/cdrom

Extract tool to home

cd ~

tar -zxvf /media/cdrom/VMware[tab]

Execute the installer

cd vmware-tools-distrib

sudo ./vmware-install.pl

Reboot

Categories: Uncategorized

A Beer Game

January 22, 2015 Leave a comment

I am drinking Left Handed Nitro Milk Stout.  This is an amazing beer.

I have a new set of NPR pint glasses.

I try pouring a beer as hard as I can into a glass, such that it will foam and head over, but I cannot accomplish my task.

Try.

Mike

Categories: Uncategorized

Fix Windows Update Corruption

December 17, 2014 Leave a comment

From:

http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_update/update-wont-in-install-code-80242007-and-code-652/60d44184-13cd-472c-91ff-06146d1d4523

You can try the following methods

Method 1:

I would suggest you to run the windows update troubleshooter

http://windows.microsoft.com/en-US/windows7/Open-the-Windows-Update-troubleshooter

Method 2:

Put the computer in ‘Clean boot’ and then try to update.

http://support.microsoft.com/kb/929135

Note: When the troubleshooting is over do not forget to reset the computer to normal startup. Follow the step 7 in the above article.

Method 3:

How do I reset Windows Update components?

http://support.microsoft.com/kb/971058

Categories: Uncategorized

Batch Build Web Deploy

Source

 

 

Categories: Uncategorized

Local RSYNC NAS Backup

rsync -rtvu /mnt/data/ /mnt/backup/Skywarp/

Note the trailing ‘/’ in the path.

 

Categories: Uncategorized

Move User Data Folder via mklink

Works very well.

How To:

http://www.windows7home.net/how-to-move-user-data-folder-to-non-system-partition-in-windows-7vista/

As you know,windows 7/vista put all system data and user data on the same partition,normally it’s drive C.Under this condition we must backup our user data every time we re-install our windows 7/vista.From windows vista ,Microsoft supply us a toolmklink which can create a symbolic link under windows 7 or vista just as the command ln under unix/linux.Below is an example about how to put user data on non-system using mklink in windows 7.
1.Enable administrator account and set a password for it.You can refer How to enable or disable administrator account in windows 7

2.Logoff and login with administrator account

3.Relocate your user data to other non-system partion,for example from C:\users\J  to D:\users\J,then REMOVE the old profile folder

robocopy /MIR /XJ   C:\Users\J  D:\Users\J

4.Use mklink to create a symbolic link from C:\users\J to D:\users\J

mklink /J C:\Users\J  D:\users\J

5.Re-login use your own account,you will find nothing changed,but in fact your physical user data is on drive D.

6.Done.The next time you re-install your OS ,just use the same user name, remove  C:\users\J then run the command of step 3 again then your user data is back.

————————————————–

Why it’s a Directory Junction and not a Directory Symbolic link:

http://superuser.com/questions/343074/directory-junction-vs-directory-symbolic-link

Categories: Uncategorized

Client OpenVPN as NAT Gateway Router to Local Network

February 19, 2013 Leave a comment

An OpenVPN server exists on the Internet. This is how an individual client will expose to all other clients of the VPN its private network.

The private network is 192.168.99.0/24. Create a ubuntu server installation.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openvpn

Go to the VPN server and login admin. Configure your user profile as Admin/Auto-login and:

openvpn-client-gateway

(not sure Admin is that important, need to remove and test)

The VPN server will now tell all clients that it will handle traffic for 192.168.99.0/24. Your client profile is now configured as a gateway for 99.0/24, so the server will NAT all traffic down the VPN to your client. However, your shiny new ubuntu client must then NAT the server traffic onto 99.0/24.

From http://codeghar.wordpress.com/2012/05/02/ubuntu-12-04-ipv4-nat-gateway-and-dhcp-server.

Everything up to Install DHCP server. Basically just enable routing and add the NAT iptables rules.

I like this post for creating your iptables https://wiki.debian.org/iptables

Log into the http openvpn server (LOGIN not CONNECT). Download your autologin profile, rename to .txt, open with WordPad (not Notepad).

Place the contents of this file in /etc/openvpn/client.conf on the ubuntu client.

Start OpenVPN client:

cd /etc/openvpn/
sudo openvpn client.conf

Categories: Uncategorized

Fun with SSH

February 13, 2013 Leave a comment

The more I use SSH the more I like it.

This post is along the same lines as my previous Git post regarding SSH tunneling to access a Git repository while behind a firewall.

I want remote access to my home ESXi server, and all it’s running instances. To do this, I will achieve RDC to a Win7 instance running on the server, install vSphere Client, and SSH to any Linux instances.

To achieve RDC I configured my ADSL modem to DMZ my DD-WRT router. I connected externally to DD-WRT via the web interface. So far so good. I then created a RDP port forward rule to my Win7 instance. Trying to connect failed.

When attempting this from work I ran into the same issue that the corporate firewall does not allow outbound connections on 3389 (RDP). Therefore my RDC client will never hit the port forward rule on dd-wrt, it can’t even get to the Internet.

I only have a few outbound ports to work with, 80 (http), 443 (https), and maybe 22 (ssh)????

Back on the DD-WRT web interface I enabled the SSH server. From my remote computer I successfully accessed my router via SSH. GREAT, I have the mechanism to poke an outbound hole in the corporate firewall.

A little research, including my previous Git/SSH post and this http://www.dd-wrt.com/wiki/index.php/Telnet/SSH_and_the_Command_Line

Essentially I used my local SSH client (PuTTY) to connect to the DD-WRT SSH Server. This connection, then creates a Local ssh tunnel, from my local port 1234 to the destination Win7:3389.

It’s important to use the word Destination instead of Remote, because there is a difference between Local port forwarding to a Destination and Remote port forwarding. The above dd-wrt-com link has a good explanation of the two.

So once I configured PuTTY properly and opened the SSH session, I then fired up RDC and connected to localhost:1234. This connection looked like this:

[work]->[corp firewall]->[Internet]->[DSL Router]->[dd-wrt]->[Win7]
or
[localhost:1234]->[ssh tunnel]->[Win7:3389]

The forwarded port in PuTTY was configured as such:

PuTTY.SSH.RDP

4L1234 192.168.2.200:3389

This essentially says:

4 – IPv4
L – Local forward
1234 – Local port that will be forwarded

192.168.2.200:3389 – The forward Destination. Where the SSH Server will forward this tunnel to.

Categories: Uncategorized

PuTTY Tunnels for Remote Access

September 21, 2012 Leave a comment

PuTTY is a great tool for network connectivity when using Tunnels. This article will show you how to create a Forward Tunnel to allow access to remote resources that would otherwise be blocked by a firewall.

In this scenerio you have a computer at work and you wish to access a remote Git server which operates via SSH on the standard port 22. However, outbound connections to port 22 are blocked by a firewall – only ports 80 (http) and 443 (https) are open. In addition the firewall operates as a HTTP proxy requiring authentication.

The first step is to establish a remote SSH server on ports 80/443. I prefeer 443 simply because it implies SSL encryption, and SSL is encrypted traffic. Adding port 443 to an OpenSSH server is very easy, simply add the line:

Port=443

to the /etc/ssh/sshd_config file, right below the existing “Port 22” line.

Restart the SSHD:

service ssh restart

You can now configure PuTTY to connect to the remote host via port 443.

It’s also easy to configure PuTTY to perform this connection through the proxy. Not all networking tools have the ability to use a proxy, which is one reason I use this technique.

PuTTY Proxy Configuration

Open your PuTTY connection and you should have no problems now reaching your remote SSH server on 443.

Next we will set up the Forward Tunnel. The Forward Tunnel will allow a local application to connect to a remote server through PuTTY. For example, I will use Git to connect to localhost on a port that PuTTY will be listening on, PuTTY will automatically forward that connection through the SSH tunnel to the remote SSH server, which will in turn forward the connection to whereever I specify.

Configure as follows. Source port is the local port PuTTY will listen on. Destination is where the connection will be forwarded to when it comes out the other end of the tunnel on the server side. In this example, the destination will be a Git server on port 443.

Note the Git server does not have to be on port 443. I can be on port 22, or any port at all. You could for example forward to http://www.google.com:80, an all local http connections on your local port 22 will reach google on port 80.

Click add and you will see the following:

This illustrates the 4L22 clearly means it’s IPv4, Local tunnel, on port 22, and shows the destination name and port.

That’s it. To use git, simply open up git bash and issue the following:

git clone git@localhost:[Repository Name]

To push changes back to the server, you first need to establish the tunnel with PuTTY, then issue:

git push master origin

Git sees the repository as being hosted locally on port 22, none the wiser that it’s call is being forwarded through PuTTY -> HTTP Proxy -> Port 443 -> Remote SSHD -> git.yourcompany.com:443

Categories: Uncategorized

Creating AWS Git Repository Volume

September 21, 2012 1 comment

See my previous post AWS Git Repository with Alestic Gitolite for creating an AWS Git Repository

I place my Git repositories on a seperate EC2 Volume for three reasons:

1. Make backup of the repositories easier vs backing up the entire Git server vai EBS Snapshots.
2. Make migrating the repositories to a new EC2 instance easier.
3. Make increasing the size of the repository volume easier.

Create the EBS volume. Be sure to select the same Zone as where you created your Git instance. The volume size should be larger then the amount of your repository data with acceptable growth space. After creation, edit the Name tag and call it “Git Repositories”.

Attach the volume to your Git instance. If you already have additional volumes attached you will need to change the default Device:

/dev/sdf

Simply make it /dev/sdg. The Alestic Git Server Ubuntu instance I’m using will automatically map that device to another device name, I’ll show you have to discover that name shortly. It may take a few minutes for the volume to attach to the instance.

Here’s a good Ubuntu post on InstallingANewHardDrive

SSH into your server. Follow the above documentation, or what I’ve written below.

To discover the device name:

sudo fdisk -l

Disk /dev/xvda1: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/xvda1 doesn't contain a valid partition table

Disk /dev/xvdf: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/xvdf doesn't contain a valid partition table

By default you should see your system volume /dev/svda1. You should also see a second volume /dev/xvdf (ifyou have more than one volume attached, it will be named differently – make note and replace appropriately in the following commands)

Create a new partition using fdisk:

sudo fdisk /dev/xvdf

Create a new (n) primary (p) number (1) default first sector / default last sector finally write (w)

The new partition will be named /dev/xvdf1 . Note the 1 to indicate the first partition.

Format the partition:

sudo mkfs -t ext4 /dev/xvdf1

Create a temporary mount point and allow write:

cd /mnt/
sudo mkdir repositories
sudo chmod 777 repositories

Mount the new volume

sudo mount /dev/xvdf1 /mnt/repositories

Disable access to Git.

Switch user to git and copy existing repositories into new volume and exit back to ubuntu user deleting the temporary mount point.

sudo su git
cd repositories
cp -R /home/git/repositories/* .
exit
sudo umount /dev/xvdf1
sudo rm -R repositories

You can at this point delete the old repositories in the /home/git/repositories folder, but I’ll leave that as an exercise for the user. Next we will mount the new volume in /home/git/repositories.

Edit fstab:

sudo nano /etc/fstab

Add the following line:
/dev/xvdf1 /home/git/repositories ext4 defaults 0 2

Mount the volume

sudo mount -a

Change ownership of the volume to user git:

sudo chown git:git /home/git/repositories

At this point reboot the server and verify. Reenable access to Git.

Categories: Uncategorized