0

Couldn't open outlook Windows

My boss asked me, why his outlook couldn't be started and keep giving the error message "Couldn't open outlook Windows". Luckily I found the solution on google.
  1. Just open the start menu dan type outlook /resetnavpane on the run command text box.
  2. If you could'nt find the run command text box, just simply press the Windows button and R button simultaneously.
Now he can start the outlook dan running faster than ever.
1

Lighttpd PHP File Upload - Error 413 request entity is too large

I'm having problem with PHP File upload running on lighttpd web server deployed on my VortexSX86. Lighttpd keep giving me the 413 error message ( 413 request entity is tool large)

Open /etc/lighttd/lighttpd.conf change the following parameters :
server.max-request-size=100000000     # or whatever you want max file size to be
server.upload-dirs=( "/mnt" ) # location to place the uploaded file
# probably should be the same as php.ini
server.network-backend="write" # this one was the key one for me

if the value of "write" doesn't work, try "writev".

server.network-backend="write" or server.network-backend="writev"
Make sure the upload directory is exist and writable.
Done.
0

GWT Property Grid Readonly

In my case I want to set the property grid to read only mode.
How I can do that?

  1. Readonly. Can't copy.

    Just add the editor event listener of the property panel, and on doBeforeEdit, set to always return false;
    LTCInfoGrid.addEditorGridListener(new EditorGridListenerAdapter(){
    @Override
    public boolean doBeforeEdit(GridPanel grid, Record record, String field, Object value, int rowIndex, int colIndex) {
    return super.doBeforeEdit(grid, record, field, value, rowIndex, colIndex);
    }
    )};

  2. Read only. Can copy & modified but reset the changes.

    Add the listener to editor listener, on doValidateEdit, set to always return false

    LTCInfoGrid.addEditorGridListener(new EditorGridListenerAdapter(){

    @Override
    public boolean doValidateEdit(GridPanel grid, Record record, String field, Object value, Object originalValue, int rowIndex, int colIndex) {
    return false;
    }
    });
0

SSH login without password

Source : http://linuxproblem.org/art_9.html
Note : Aku dah try. Jalan.

Your aim

You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.

How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A

Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):

a@A:~> ssh b@B mkdir -p .ssh

b@B's password:

Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:

a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:

From now on you can log into B as b from A as a without password:

a@A:~> ssh b@B hostname
B
A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:

* Put the public key in .ssh/authorized_keys2
* Change the permissions of .ssh to 700
* Change the permissions of .ssh/authorized_keys2 to 640
0

Web Auto Update (Linux + PHP)

In my project, the controller will be place at the remote site (like sabah & sawarak) and having sluggish internet connection. I need the controller to automatic update the firmware during the transfer.

How to do it?
  1. download the update script.

    wget http://192.168.0.8/ipvision-client/tools/autoupdate.php?id=IPV0001 -O autoupdate.sh

  2. Change the script file permission to allow execute.
    /bin/chmod 777 autoupdate.sh

  3. Execute the script

    bin/sh /tmp/autoupdate.sh

  4. update the status, so this operation not reoccur.

    wget http://192.168.0.8/ipvision-client/tools/autoupdate.php?id=IPV0001&action=done

  5. put the script on cron job.

0

Fileupload firmware update (linux + php)

I would like to perform the firmware update over file upload in my current project.
In my case I'm using Linux + PHP running on my vortex86SX controller.

How to do it ??

  1. Just pack all the updated files together and create a installation script (shell script) called installupdate.sh.
  2. Since shell script created is created on Windows, Linux is having problem to execute the script since it don't understand the additional trail ("\r") for new line. I use this command to remove the "\r" character.

    /bin/cat /tmp/installupdate/installupdate.sh | /bin/tr -d "\r" > /tmp/installupdate
  3. change permission of installation script to enable execute.
  4. run the installation script
  5. remove all the temporary files
Full code :
function installupdate(){
$uploadfile = '/tmp/installupdate.zip';
//phpinfo();
if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $uploadfile)) {
$cmd='/bin/mkdir /tmp/installupdate
/bin/unzip -o /tmp/installupdate.zip -d /tmp/installupdate
cd /tmp/installupdate/
/bin/cat /tmp/installupdate/installupdate.sh | /bin/tr -d "\r" > /tmp/installupdate/installupdate.sh
/bin/chmod 777 /tmp/installupdate/installupdate.sh
/bin/sh /tmp/installupdate/installupdate.sh
/bin/rm /tmp/installupdate.zip
/bin/rm /tmp/installupdate -r
'
;
echo "File is valid, and was successfully uploaded.\n";
system("$cmd");
} else {
echo "Possible file upload attack!\n";
}
}
0

GWT-Ext & PHP , Glassfish & Apache

Berikut cara macam mana nak guna GWT-Ext dalam Galssfish dan data dalam Apache-PHP.

1. Install Quercus. Ni carik post aku sebelum ni.
2. Create gateway script dalam glassfish (php-Quercus). Nama fail sebaiknya sama dengan nama fail dalam apache (php).

Fail scriptnya adalah seperti di bawah. Support untuk GET, POST & SESSION.


// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://localhost/adapt-gwt/index.php");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);

curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');

curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);

// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
?>
0

Install quercus -100% Java implementation of the PHP

Berikut adalah cara-cara untuk install quercus.

1. Download fail .war dari web http://quercus.caucho.com/
2. Deploy fail .war dalam glassfish.
3. Extract fail .war dan copy semua fail .jar dalam folder /WEBINF/lib/ ke folder GLASSFISH_HOME/domains/domain/lib.
4. Tambah servlet & mapping dalam web.xml


<servlet>

<servlet-name>Quercus Servlet</servlet-name>

<servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>Quercus Servlet</servlet-name>

<url-pattern>*.php</url-pattern>

</servlet-mapping>



6. create fail index.php dan deploy.
7. Try access fail php dari web browser.
0

GWT-Ext dengan PHP

Oleh kerana aplikasi GWT-Ext perlu menggunakan JAVA, agak susah untuk menggunakan data dari domain yang berlainan. Contohnya :

GWT -Glassfish guna port 16476.
PHP-Apache guna port 80.

Terdapat 2 cara untuk menggunakan php.
1. Install quercus -100% Java implementation of the PHP dan guna quercus ni saja.
2. Install quercus -100% Java implementation of the PHP dan guna PHP pada apache web server pada port 80. Kena pakai CURL.
0

SSH Reverse Tunneling

Hari yang x berapa memberansangkan walapun banyak keje siap hari ni.
Hari ni aku nak cerita sikit pasal SSH Remote Tunnling. Aku buat ni sebab aku nak masuk ke Linux board aku yang aku remote site tapi dia x de public ic untuk access direct. So kena la buat ssh reverse tunneling.

Dekat Controller :
ssh -R 2000:127.0.0.1:22 root@remoteserver.com

Dekat PC aku pulak kena buat 2 connection.

1st untuk buat poft forwarding port ke local port.
ssh -L 90:127.0.0.1:2000 root@remoteserver.com

jadi aku dah buat tunneling port 90 (pc aku) ke port 2000 kat remote server --> controller port 22.

Jadi, untuk masuk ke console controller aku tu :
ssh root@127.0.0.1 -p 90

jadi boleh la aku masuk ke console controller aku tu dan buat la apa-apa yang aku nak buat.
0

.NET Licensing

I'm going to put the license component in my .Net program and considering the license for developer and run time.Microsoft already provide several licensing model in .NET such as Registry or Lic File.As for me, I'm prefer to use WMI with a propitiatory algorithm such as encryption to generate the license as I can generate an unique license key for each computer.

This how we could do that :

For Developer (Design Time) :

if (System.ComponentModel.LicenseManager.CurrentContext.UsageMode ==
System.ComponentModel.LicenseUsageMode.Designtime)
{
throw new System.Exception("Design Time License Required");
}



For run time :


if (System.ComponentModel.LicenseManager.CurrentContext.UsageMode == System.ComponentModel.LicenseUsageMode.Runtime)
{
throw new System.Exception("Run Time License Required");
}


For more details you can refer to these links :

  1. http://www.developer.com/net/net/article.php/11087_3074001_1/Applications-Licensing-using-the-NET-Framework.htm
  2. http://msdn.microsoft.com/en-us/library/fe8b1eh9.aspx
0

How to display your web site logo on the address bar and in the favorites list

Source : http://www.chami.com/tips/internet/110599I.html

Want to make your web site standout in crowded favorites lists in browsers and address bars? How about displaying your logo next to links to your site.
First, you have to create a logo for your site; a very tiny logo to be specific. The size of the logo should be 16x16 pixels and it should be saved as a Windows icon file (logo.ico for example). If your image editor doesn't support saving files in Windows icon format, you can use the following online tool or download an icon editor from a shareware site.

Once you have an icon file with your logo, you're ready to take the final step. Following methods will work in Explorer 5.x and higher without having any negative effects on other browsers.
Method 1
This is the easiest method to implement and it will work regardless of the particular page on your site users choose to add to their favorites list. Don't worry if you don't have access to your web site root; take a look at the next method.
If you have access to the root of your web site, simply save your icon file as "favicon.ico" there. For example, if your web site is "www.chami.com", your icon file should be available at "www.chami.com/favicon.ico". The web browser will look for favicon.ico whenever your site is added to the favorites list and if it is found at the root of your web site, the icon will appear next to the link to your site.
Method 2 If you don't have access to the root of your web site, you have to add the following tag to your web page so that the browser will know where to look for your icon. Unlike before, this time you can save the icon under any name ending with ".ico" We'll use the name "logo.ico" and assume that your web site is under the directory "~your_directory".

<link rel="SHORTCUT ICON" href="/%7Eyour_directory/logo.ico">



Above tag should be inserted in-between the and tags.
By the way, you can specify multiple logos for multiple pages using the second method. Simply save your icons using unique names, such as logo1.ico, logo2.ico, logo3.ico for example, and replace "logo.ico" in the above HTML code with the name of the icon you want to use for any particular page.
 
Copyright © peyotest