Showing posts with label Tips and tricks. Show all posts
Showing posts with label Tips and tricks. Show all posts

Tuesday, March 12, 2013

How to shrink your disk on VMware Player 5 ?

As the option seems to have disappeared from the VMware tools menu, these are commands to shrink your VMware disk on Windows or Linux.


Shrinking the virtual disk in a Windows virtual machine

To shrink the virtual disk in a Windows virtual machine:
  1. Power on the Windows virtual machine.
  2. Open a Command Prompt with administrator privileges.
  3. Run these commands:

    cd C:\Program Files\VMware\VMware Tools
    C:\Program Files\VMware\VMware Tools> VMwareToolboxCmd help disk
    This displays a list of options that are available for shrinking.

Shrinking the virtual disk in a Linux virtual machine

To shrink the virtual disk in a Linux virtual machine:
  1. Open Terminal.
  2. Run these commands:

    cd /usr/bin

    /usr/bin$ vmware-toolbox-cmd help disk


source: http://communities.vmware.com/thread/420371

Wednesday, December 14, 2011

Disable autoplay / autorun on Windows 7

Method 1
  1. Click Start, type Gpedit.msc in the Start Search box, and then press ENTER.
    If you are prompted for an administrator password or for confirmation, type the password, or click Allow.
  2. Under Computer Configuration, expand Administrative Templates, expand Windows Components, and then click Autoplay Policies
  3. In the Details pane, double-click Turn off Autoplay.
  4. Click Enabled, and then select All drives in the Turn off Autoplay box to disable Autorun on all drives.
  5. Restart the computer.
Method 2
  1. Click Start, type Gpedit.msc in the Start Search box, and then press ENTER.
    If you are prompted for an administrator password or for confirmation, type the password, or click Allow.
  2. Under Computer Configuration, expand Administrative Templates, expand Windows Components, and then click Autoplay Policies.
  3. In the Details pane, double-click Default Behavior for AutoRun.
  4. Click Enabled, and then select Do not execute any autorun commands in the Default Autorun behavior box to disable Autorun on all drives.
  5. Restart the computer. 




Saturday, September 10, 2011

Monday, September 5, 2011

How to copy a directory and all subs from MSDOS ?

Use the xcopy DOS command with the option 'E' to include all sub-directories (with empty one).
  
xcopy "c:\your source folder" "d:\your destination folder" /E

For more information:
http://www.computerhope.com/xcopyhlp.htm

Tuesday, August 9, 2011

Activer "Remote Desktop" sous Windows XP

Pour donner l'accès à votre machine dans le réseaux via "Remote Desktop", il faut cocher une propriété dans la fenêtre suivante :
  • Cliquer sur "Start" (Démarrer) OU aller sur le desktop.
  • Cliquer droit sur "My Computer" et sélectionner "Properties" OU [ALT] + Double clique ;)
  • Cliquer sur l'onglet "Remote".
  • Dans la partie "Remote Desktop", cocher "Allow users to connect remotely to this computer".
Attention également que le firewall de Windows permette la connection.
Start > Control Panel > Windows Firewall >
* Exceptions tab > check "Remote Desktop"
* Advanced tab > Local Area Connection > Settings > check "Remote Desktop"

Sunday, July 31, 2011

10 astuces pour faire des économies

En ces temps de crises, voici 10 astuces pour épargner. Une qui m'a bien plu est la suivante :

"Translate dollars spent into hours worked to earn those dollars spent"

Connaitre son taux salaire horaire permet de se rendre compte du nombre d'heure à prester avant d'acquérir un bien ...

Optimiser Eclipse

1. Paramètre de lancement :

Changer la cible (target) dans le lien pour lancer Eclipse comme suit :

%path_to_eclipse%\eclipse.exe -vm %path_to_jdk%\jre\bin\client\jvm.dll

Avantages :
  • l'écran de lancement vient plus rapidement.
  • Le processus est affiché comme 'eclipse.exe' et non plus en tant que 'java.exe'.
  • Pare-feu (Firewalls): Eclipse accède à Internet au lieu de Java.
  • Meilleure gestion sous Windows & Mac.
2. Modifier le fichier '%path_to_eclipse%\eclipse.ini' comme suit :

-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
-vm
jdk1.6.0_10\jre\bin\client\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx384m
-Xss2m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-XX:CompileThreshold=5
-Dcom.sun.management.jmxremote

3. Vous pouvez également utiliser la console Java en lançant l'exécutable suivant :

%path_to_jdk%\bin\jconsole.exe

Tuesday, July 26, 2011

Raccourcis pour créer un nouveau répertoire sur Win7 : [Ctrl]+[Shift]+[N]

Tout est dans le titre ... le raccourci clavier qui manquait dans les versions précédentes de Windows. Il donne un nouveau chemin plus court par rapport à l'habituel et assez fastidieux:
-> clique droit > "New" > "Folder".

[Ctrl]+[Shift]+[N] to create a new directory in Windows 7.

Monday, July 4, 2011

Recover a date yyyymmdd from a timestamp in SQL

This is the problem: I have a field in time-stamp format in my database. I would like to use a SQL statement to retrieve this date in format yyyymmdd. This is the select I have used:

Select
   replace(char(date(your_field), ISO), '-', '')
from
   your_table

Add +1 to your pages to help your site stand out

Go to this Google website page:

http://www.google.com/webmasters/+1/button/index.html

Friday, March 18, 2011

Supprimer les espaces dans le code source des pages JSP

Suite à un ancien post qui donnait une solution pour supprimer les espaces non nécessaires dans les JSP généré par le code JSTL:

http://micro-mind.blogspot.com/2007/02/supprimer-les-espaces-dans-le-code.html

Cette solution avait les désavantages de supprimer TOUS les espaces ('le code' devenait 'lecode' s'il n'était pas encodé comme suit: 'le code') et de perdre l'indentation du code.

La norme JSP 2.1 supporte une nouvelle directive:
<%@ page trimDirectiveWhitespaces="true" %>
Celle-ci supprime les espaces et lignes vides générés par le JSTL sans perdre l'indentation.
Si vous utilisez Servlet 2.5 XSD, vous pouvez également utilisez le tag suivant dans votre descripteur de déploiement:
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
source: http://raibledesigns.com/rd/entry/trim_spaces_in_your_jsp1

Use scheduled task to start / stop Windows Service

Windows doesn't offer to schedule start / stop of a Windows Service in a range of a time. But you can use this tips to do this.
Create 2 batch files named 'startMyService.bat' and 'stopMyService.bat' with the following content

# 'startMyService.bat'
# batch file to start my service
@echo off
net start "my Windows Service name"

# 'stopMyService.bat'
# batch file to stop my service
@echo off
net stop "my Windows Service name"

Next if you want for example that your service runs between 8h00AM and 5h00PM you can schedule the execution of 'startMyService.bat' at 8h00AM and schedule the execution of 'stopMyService.bat' at 5h00PM.
To schedule the execution of a program, go to 'Start' > 'Settings' > 'Control Panel' > 'Scheduled Tasks' > 'Add Scheduled Task' and follow the wizard.

Saturday, February 12, 2011

Clause LIKE % avec des paramètres dans une procédure stockée

Petite astuce pour exécuter un statement SQL avec une clause LIKE % et un paramètre dans une procédure stockée (Stored Procedure).

 1 CREATE PROCEDURE [dbo].[Example]
2
3 @param nvarchar(25)
4
5 AS
6 BEGIN
7 SET NOCOUNT ON;
8
9 DECLARE @sql nvarchar(MAX)
10
11 SET @sql =
12 'SELECT * FROM table WHERE table.field LIKE ''%' + @param + '%'' '
13
14 EXEC sp_executesql @sql
15
16 END


Sunday, February 6, 2011

Raccourcis clavier pour créer un répertoire dans Windows 7

Ah, enfin ! Il est possible de créer un répertoire dans Windows Explorer (Windows 7) avec le raccourcis clavier suivant :
[Ctrl] + [Shift] + N

Wednesday, December 8, 2010

Visual Sutio 2005 shorcuts

[Ctrl + K], [Ctrl + C] --> comment the line
[Ctrl + K], [Ctrl + U] --> uncomment the line
[Shift + Alt + F10] --> display a list box to refactor

Tuesday, November 30, 2010

Remove a Windows Service (DOS command)

This DOS command to remove a Windows Service is very usefull!

sc delete < service_name >

Monday, October 18, 2010

Désactiver le pavé numérique sur un portable

Gros problème ce matin avec le PC d'un collègue. Il a acheté un Clavier sans fil pour son ordinateur portable. Mais lorsqu'il ne l'utilise pas, il a la fonction 'pavé numérique' activée sur le clavier du portable! Pas moyen de trouver l'option ou la combinaison de touche pour la désactiver.
Après quelques temps de recherche, je suis tombé sur cette solution :
En fait c'est la touche "numlock" qui a été activé sur le clavier externe et qui est toujours active. Comme elle n'est pas disponible sur le clavier du portable, voici la manipulation à faire
Start > programs > accessories > accessibility > On-Screen Keyboard
(FR: Démarrer > Tous les Programmes> Accessoires> Accessibilité > Clavier Visuel)



Clickez sur la touche "nlk" pour la désactiver !
Enjoy ;)

Monday, September 20, 2010

Google Chrome Installation error "Unknow Installer Error"

When I try to launch the executable file 'ChromeSetup.exe' from google.com, I receive the following error :



To solve this, go to http://pack.google.com/ and create your application pack with Google Chrome only.

Tuesday, May 25, 2010

How to upgrade your Nokia 5800 Xpress Music ?

1. Key *#0000# into your phone's home screen.
2. Select Options > Check for updates.
3. Follow the on-screen prompts until your update is complete!