marți, 29 iunie 2010

Setting keep alive for unix

We have to change the value shown by:
>cat /proc/sys/net/ipv4/tcp_keepalive_time

-usually is 7200

To change it:
- >sudo vi /etc/rc.local #to remain after boot
- echo "900" > /proc/sys/net/ipv4/tcp_keepalive_time #to modify
- >sudo /etc/rc.local #to have it

Other way:
- >sudo sysctl -w net.ipv4.tcp_keepalive_time=1800

miercuri, 23 iunie 2010

Moving from Windows XP to Linux Ubuntu

It was easy because all you have to is to just copy a folder, usually from 'Documents and Settings\\Application Data', to your home directory /export/home/:
-email - Thunderbird - the profile folder
-text editor - Jedit - the .jedit folder
-DB client - Squirrel - .squirrel
-IM - pidgin - .purple

miercuri, 9 iunie 2010

Automate Windows XP services management

When are problems and don't want to manually process all Windows XP services, the tool below can be used :

(thx to http://commandwindows.com/sc.htm )
services_automate.bat :

@echo off

set lp=%~dp0

cd %lp%
rem sc [command] [service name] ...
rem interesting is also the "config" command

echo "Starting setting of services to automatic"
for /F "delims= " %%i in (%lp%\services_names.txt) do (
echo "%%i"
sc start %%i
)
echo End
rem pause

(I got it from web, but can't find now the source to mention :( )
services_names.txt :
ALG
AppMgmt
AudioSrv
BITS
Browser
CryptSvc
DcomLaunch
Dhcp
dmadmin
dmserver
Dnscache
ERSvc
Eventlog
EventSystem
IDriverT
IISADMIN
lanmanserver
lanmanworkstation
LmHosts
MDM
MSDTC
MSFtpsvc
napagent
NetDDE
NetDDEdsdm
Netlogon
Netman
NetSvc
Nla
NMSAccess
NtLmSsp
NtmsSvc
ntrtscan
OfcPfwSvc
PlugPlay
PolicyAgent
ProtectedStorage
RasMan
RemoteAccess
RpcLocator
RpcSs
SamSs
Schedule
seclogon
SENS
SharedAccess
ShellHWDetection
SMTPSVC
Spooler
srservice
SSDPSRV
stisvc
TapiSrv
TermService
Themes
tmlisten
TrkWks
upnphost
UPS
VSS
W32Time
W3SVC
WebClient
winmgmt
Wmi
WmiApSrv
wuauserv
WZCSVC

marți, 20 aprilie 2010

De cand fumatul pe strada a devenit ceva normal?

Dai cu fum in mine, dau cu apa in tine.

ps:
De cand multe obiceiuri incriminate de codul bunelor maniere au devenit normalitate ca manifestare in public?

vineri, 2 aprilie 2010

Status

I'll start to post my im status messages.

Till now I had:

-De ce e civilizatie in afara? Din cauza educatiei
Sistemul de educatie de la noi permite avansarea celor care nu sunt pregatiti, fie ca sistemul de evaluare este slab (scolile de soferi), fie ca evaluatorii o permit (invatamantul)

- A lot of children and women smoking
Why only women and not men quoted ? Because they carry the baby.

- Did you kiwi (wiki) your knowledge ?
Sharing of information is our civilization engine. Some think if keep it unshared, they have the advantage. But they don't realize that they already know it, understand and use it. They have and keep their advantage of time until the others understand and can use that information.

- No coffee, no work
Fact: people drink coffee (tee) at work. As employer, do you want they spent time in preparing and consuming or just in consuming?

joi, 18 februarie 2010

How to add week numbers to Google Calendar?

It is very simple after understood:
- open the Calendar page
- on left notice "Other calendars"
- press "Add"
- "Browse interesting Calendars"
- "Holiday" tab is selected by default
- Click "More" tab
- on line with "Week Numbers" click "Subscribe"
- done, click "Back to calendar"

In "Week" view, it appears for the first day of the week (can be set), above the hours.
In "Month" view, it appears for each first day of the week.



If tried to search for help:
- you get this page
- but there can't be found the info
- you have to open "More"
- there you'll find the "Week Number" procedure

miercuri, 6 ianuarie 2010

jedit - locally backup with timestamp the FTP modified files

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)