Thursday, August 21, 2014

how to install DWM-156 for linux server (ubuntu)





first

change usb modem mode ( from cd to modem)

mkdir /media/cdrom
mount /dev/srX /media/cdrom
X is 0,1,2,3...

install dlinkusbmodem.deb

sudo dpkg -i dlinkusbmodem.deb 

run that file 


usbdeviceswitchdlink

setting usb modem mode

 sudo modprobe usbserial vendor=0x2001 product=0x7D00

Note make sure already install wvdial

sudo apt-get install wvdial

Setting wvdial.conf

wvdialconf

sudo vi /etc/wvdial.conf

remove ; in wvdial.conf
Example of file

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","internet"
Phone = *99#
Modem Type = Analog Modem
Stupid Mode = 1
Baud = 9600
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Password = ;
Username = ;


and start dial by

sudo wvdial


setting gateway

route add default gw 192.168.1.254 eth0

Tuesday, July 29, 2014

set row and column in cm

How to set cell size in cm (centimeters) in Excel?

On a worksheet, the default units for the row height and column width are preset, and the default column width is 8.38 characters and the default row height is 12.75 points. And in Excel, it is difficult for you to set the row height or column width in inches or centimeters. But, sometimes you need to change the height and width to centimeters for some purpose. How could you solve this problem?
Kutools for Excel: add 120 new features in Excel. Save one hour every day.
Classic Menu for Office: brings back classic menus to Office 2010 and 2013 (includes Office 365).
Office Tab: brings tabbed interface to Office as the use of web browser Chrome, Firefox and Internet Explorer.

arrow blue right bubble Set cell size in cm (centimeters) with VBA code

Hot
Amazing! Using Tabs in Excel like Firefox, Chrome, Internet Explore 10!
You can’t set the height and width in centimeters with Excel’s functions, except for using VBA code. The below two codes can help you to set column width and row height. Do as follows:
1. Select the cells that you want to set them in centimeters.
2. Click Developer > Visual Basic, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, and input the following code into the Module:
Code for setting row height in centimeters:
Sub RowHeightInCentimeters()
Dim cm As Single
cm = Application.InputBox("Enter Row Height in Centimeters", _
"Row Height (cm)", Type:=1)
If cm Then
Selection.RowHeight = Application.CentimetersToPoints(cm)
End If
End Sub
3. Then click doc-multiply-calculation-3 button to execute the code. And a prompt box will pop out to tell you to enter a number of row height. See screenshot:
doc-set-cell-size-cm1
Note: the number you enter must be less than 15. And this VBA code won't change row height if you enter 0 in this dialog box.
4. Click OK. And the row height of the selected cells have been set with 2 centimeters. See screenshot:
doc-set-cell-size-cm2-2doc-set-cell-size-cm3
If you want to set the column width in centimeters as well, you can input the following code:
Code for setting column width in centimeters:
Sub ColumnWidthInCentimeters()
Dim cm As Single, points As Integer, savewidth As Integer
Dim lowerwidth As Integer, upwidth As Integer, curwidth As Integer
Dim Count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("Enter Column Width in Centimeters", _
"Column Width (cm)", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "Width of " & cm & " is too large." & Chr(10) & _
"The maximum value is " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "Width Error"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
Count = 0
While (ActiveCell.Width <> points) And (Count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
Count = Count + 1
Wend
End Sub

arrow blue right bubble Set cell size in cm (centimeters) with Kutools for Excel

With the above codes, you can only set cell size in centimeters, today, I will introduce you a multifunctional tool, Kutools for Excel which not only can set cell size in centimeters but also in inches, pound and pixels.
Kutools for Excel: with more than 120 handy Excel add-ins, free to try with no limitation in 30 days. Get it Now.
After installing Kutools for Excel, you can quickly set row height and column width with the following steps:
1.Highlight the cells that you want to set them in centimeters.
2. Click Kutools > Range Converter > Adjust Cell Size, see screenshot:
doc-set-cell-size-cm4
3. In the Adjust Cell Size dialog box, choose the Unit type you need and specify the Row height and Column width from Set values. See screenshot:
doc-set-cell-size-cm5
4. Then click OK or Apply. You will get cells with 2 cm row height and 3cm column width.
doc-set-cell-size-cm6
With this function, you can also set cell size in pound, inches and pixels. Click to know more about this feature.

Related articles:
Set column width and row height for a range
How to square multiple cells in Excel?

Kutools for Excel

More than 120 Advanced Functions for Excel 2013, 2010, 2007 and Office 365.

screen shot
btn read more     btn download     btn purchase

Friday, May 16, 2014

ubuntu telnet server

sudo apt-get install telnetd

 sudo /etc/init.d/inetd restart

Wednesday, February 12, 2014

ubuntu share internet

Before I begin this post, I want to thank Internet Connection Sharing – Ubuntu 10.04 NAT Gateway Setup (Abridged Version) for providing the bulk of the tutorial. I have made some modifications for Ubuntu 12.04.
The setup is simple: a single Ubuntu server will act as a gateway and DHCP server for a local network. All other machines on the local network will receive their IPs from the DHCP server. To make things easier, I’ll call this Ubuntu server “Skyray” for the rest of the post.
Skyray has two network interfaces, eth0 and eth1. eth0 is on the 10.20.30.0/24 subnet and this is the Internet facing interface. eth1 is on the 172.22.22.0/24 subnet, where all other machines are also present. Basically, eth0 will connect to the Internet and eth1 will serve DHCP requests and act as the gateway.

/etc/network/interfaces

First you need to configure eth0 and eth1 for Skyray. Edit the file and make sure it has at least the following settings (or whatever settings are appropriate for your environment).
sudo vim /etc/network/interfaces
(:wq save and quit, i insert mode , esc exit insert mode, :q! exit not save)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
    address 192.168.10.1
    netmask 255.255.255.0
    network 192.168.10.0
    broadcast 192.168.10.255

/etc/sysctl.conf

You need to enable IPv4 forwarding. To do so, edit this file.
sudo vim /etc/sysctl.conf
And uncomment the line
# net.ipv4.ip_forward=1
so that it now appears as
net.ipv4.ip_forward=1
Save the file and run the following command to make the change effective without a reboot.
sudo sysctl -w net.ipv4.ip_forward=1

/etc/rc.local

You’ll need to allow iptables rules for NAT to work. Edit the file and save it.
sudo vim /etc/rc.local
Make sure the following two lines appear before the exit 0 line in the file.
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables --table nat -A POSTROUTING -o eth0 -j MASQUERADE
To make these iptables rules active without rebooting, run the following commands:
sudo iptables -P FORWARD ACCEPT
sudo iptables –-table nat -A POSTROUTING -o eth0 -j MASQUERADE

Tuesday, February 4, 2014

Applying Hotfixes on Citrix Xenserver 6.2 hypervisor without XenCenter

Citrix Xenserver is a beautiful open source (from 6.2 edition and later) hypervisor that tries to grab as much as possible market share on virtualization/cloud world. It carries many years of development efforts by Citrix, many well established implementations and a broad support community.
XenMotion, High Availability and all the great features of Xenserver are available on the licensed and unlicensed versions of the hypervisor. The licensed version includes automated patches and updates through XenCenter console and 24×7 Citrix Technical Support. On the unlicensed version, the administrator should apply the xenserver patches by himself through an ssh console. XenCenter still notifies the availability of new patches.
So, on XenCenter when you goto Tools – Install Updates, you get grayed out options like this
XenCenter Upadtes Installation
XenCenter Upadtes Installation
So, first of all we should download the new patches from Citrix webserver, XenCenter will help you to do so. Then unzip the contents of the downloaded files and secure ftp them on XenServer.
Ftp the updates to XenServer
Ftp the updates to XenServer
I use filezilla to sftp the updates to XenServer in binary transfer mode and upload them to /var/tmp directory. Then ssh to XenServer (I use putty utility to do so but you can use anything you are comfortable with). Login as root and run the following command
xe patch-upload file-name=/var/tmp/
this command produces a uuid alphanumeric string. Copy it to the clipboard and on XenCenter notice the yellow down icons that appear, indicating that a hotfix or update exists but has not been applied.
XenCenter warning icon
XenCenter warning icon
Run
xe patch-pool-apply uuid=
pasting the uuid string. You may verify the applied patches by running
xe patch-list
Verifying patches
Verifying patches
If the update has been successful, the hosts field should contain the uuids of all the hosts in the pool. Finally, run
xe-toolstack-restart
to reload the toolstack on all hosts, you may loose the connection if you run it on Pool Master.
Applying Patches
Applying Patches
Now, your XenServer is patched!