Starting from
http://community.jedit.org/?q=node/view/1209#7340 - which does only 1 file, I wanted a file for each save. I've done it using timestamp in format yyyymmddhhmmss.
(error: if system date is changed, it's possible a file to be overwritten)
//---------save-backup.bsh------------
import java.util.Calendar;
import java.text.SimpleDateFormat;
//backup path
BackupPath = "Z:\\Jedit_backups\\"; //don't forget the trailing \\
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
timestamp = sdf.format(cal.getTime());
path = buffer.getDirectory();
path = path.replaceFirst("ftp://", "");
path = path.replace('/', '\\');
path = path.replaceAll(":", ""); //this is for local files (c:\ -> c\
//todo : remove other unwanted characters ?
path = BackupPath + path;
(new File(path)).mkdirs(); //create the backup directory if it doesn't exist
path = path + buffer.getName() + '_' + timestamp;
// buffer.getLastModified(); - fails for FTP: puts 0 - all the time
buffer.save(view,path,false); //save copy
VFSManager.waitForRequests();
buffer.save(view,null,true);
Macros.message(view, "Backup done in " + BackupPath);
//--------end
- put this in a file, eg save-backup.bsh
- put the file in a subfolder (eg Files) of 'macros' folder from jedit installation
- open jedit
- Utilities > Global Options > Shortcuts
- enter, in the 'filter' field, the name of the file
- click in the 'Primary shortcut'
- press CTRL + s (the 'Save' shortcut)
- accept the override
- in 'Saving & Backup' put the 'Max number of backups' to 0 (zero - it disables other backups)
- press OK to save changes
(done in Jedit 4.3)
miercuri, 6 ianuarie 2010
marți, 10 noiembrie 2009
Firefox: change search engine to other Google
I wanted that search engine from Firefox to return results using my Google.
- The solution is to edit the google.xml from searchplugins in ... Firefox Installation directory
- Solution is NOT in :
* about:config
* Documents and Settings \ \Application Data\
* Documents and Settings \ \Local Settings\Application Data
- The solution is to edit the google.xml from searchplugins in ... Firefox Installation directory
- Solution is NOT in :
* about:config
* Documents and Settings \
* Documents and Settings \
miercuri, 28 octombrie 2009
Change volum of sound from keyboard
On XP:
I use ZVolume home 4.
Setting > Hotkeys > Volume
Default are CTR+ALT+Num +/-. After change, I restart it to work.
I use ZVolume home 4.
Setting > Hotkeys > Volume
Default are CTR+ALT+Num +/-. After change, I restart it to work.
vineri, 9 octombrie 2009
auto login in windows
https://www.microsoft.com/windowsxp/using/setup/learnmore/tips/knox2.mspx
Submitted by Doug Knox, Microsoft MVP, Tewksbury, Massachusetts
You can configure Windows XP to automate the logon process if your computer is not part of a domain.
1 Click Start, click Run, and type control userpasswords2.
2 Clear the Users must enter a username and password to use this computer check box.
3 Click Apply.
4 Enter the user name and password you wish to automatically log on with, and then click OK.
5 Click OK again and you're all done.
This feature allows other users to start your computer and use the account that you establish to automatically log on. Enabling auto logon makes your computer more convenient to use, but can pose a security risk.
Submitted by Doug Knox, Microsoft MVP, Tewksbury, Massachusetts
You can configure Windows XP to automate the logon process if your computer is not part of a domain.
1 Click Start, click Run, and type control userpasswords2.
2 Clear the Users must enter a username and password to use this computer check box.
3 Click Apply.
4 Enter the user name and password you wish to automatically log on with, and then click OK.
5 Click OK again and you're all done.
This feature allows other users to start your computer and use the account that you establish to automatically log on. Enabling auto logon makes your computer more convenient to use, but can pose a security risk.
miercuri, 30 septembrie 2009
Sync on Windows
Below is a way to do automatically sync on Windows using a tool and run a script before the Logoff operation.
- Microsoft has a tool called SyncToy (or other one: DirSyncPro)
* create a batch file with :
rem using DirSyncPro
rem Using SyncToy
echo "Starting sync: ">> c:\Sync.txt
date /t >> c:\Sync.txt
time /t >> c:\Sync.txt
"C:\Program Files\SyncToy 2.0\SyncToyCmd.exe" -R
echo "Ended sync: ">> c:\Sync.txt
time /t >> c:\Sync.txt
To run it before logoff:
-http://support.microsoft.com/kb/307882 :
* run gpedit.msc
* User Configuration > Windows Settings > Scripts (Logon/Logoff)
* double click on Logoff script and Add the batch file
- Microsoft has a tool called SyncToy (or other one: DirSyncPro)
* create a batch file with :
rem using DirSyncPro
rem Using SyncToy
echo "Starting sync: ">> c:\Sync.txt
date /t >> c:\Sync.txt
time /t >> c:\Sync.txt
"C:\Program Files\SyncToy 2.0\SyncToyCmd.exe" -R
echo "Ended sync: ">> c:\Sync.txt
time /t >> c:\Sync.txt
To run it before logoff:
-http://support.microsoft.com/kb/307882 :
* run gpedit.msc
* User Configuration > Windows Settings > Scripts (Logon/Logoff)
* double click on Logoff script and Add the batch file
Etichete:
batch,
before logoff,
script,
sync,
synchronize
marți, 29 septembrie 2009
jEdit
*Plugins
-ProjectViewer, SideKick, XML, FTP
*How to beautify other files?
- Global Options > Editing > Change settings for mode
-Note the "File name glob"
-Note the "First line glob"
Ex: to have on "v8_config.cfg" same beautify as on shell script, select it from modes list, add "cfg" in "File name glob" and remove the "First line glob" value (let it empty)
-activate Backup : Utilities > Global Settings > Saving & Backup :
* deactivate "Two-stage" ( since we work a lot on Unix)
* add numbers at suffix: remove the suffix character ; set the Max Number of Backups
*Macros->Misc->Hypersearch Result to Buffer.
-ProjectViewer, SideKick, XML, FTP
*How to beautify other files?
- Global Options > Editing > Change settings for mode
-Note the "File name glob"
-Note the "First line glob"
Ex: to have on "v8_config.cfg" same beautify as on shell script, select it from modes list, add "cfg" in "File name glob" and remove the "First line glob" value (let it empty)
-activate Backup : Utilities > Global Settings > Saving & Backup :
* deactivate "Two-stage" ( since we work a lot on Unix)
* add numbers at suffix: remove the suffix character ; set the Max Number of Backups
*Macros->Misc->Hypersearch Result to Buffer.
vineri, 24 iulie 2009
Abonați-vă la:
Postări (Atom)