Thursday, 7 November 2013

Running two separate skype profiles

If you want to run on two independent skype instances one a single machine, for example one for your personal skype account, and one for your work account, it's very simple.

Create a shortcut to your skype.exe.
Right-click it, select "Shortcut" tab.
Add /secondary to the Target field, if you have installed Skype on the default location, then this would look something like:
"C:\Program Files (x86)\Skype\Phone\Skype.exe" /secondary
Click OK to save changes and your are done.

Enjoy your alternative second skype.

Wednesday, 6 November 2013

ERROR 267 (0x0000010B) Scanning Source Directory DIRNAME The directory name is invalid. Jenkins

A job that I run on my Jenkins CI suddenly started having this error:

ERROR 267 (0x0000010B) Scanning Source Directory DIRECTORY-PATH The directory name is invalid.


The job was using a robocopy command to find and copy all config.xml files from the JENKINS_HOME/jobs and commit them to the SVN repository for backup.
This job which was causing the issue was a matrix type of job, that was previously running on multiple slave nodes and later was changed to run to a different node, so there were left old folders in the directory:

JENKINS_HOME\jobs\JOBNAME\configurations\axis-label\NODENAME\...

So now I had these folders in that location:
\Old_NODENAME
\Current_NODENAME


What I did was to delete the \Old_NODENAME, as it obviously was not done automatically by Jenkins once I had changed the matrix configuration (the nodes I want the job to run simultaneously)

Then I run the job again, to just make sure it was passing successfully.

I also manually deleted the info about the Old_NODENAME which was stored at the SVN.
After performing these two steps, I run the failing job again, and the error 267 was fixed.

Old and irrelevant content in the job's workspace on JENKINS_HOME/jobs and on the SVN where the job commits, were causing ERROR 267 (0x0000010B) Scanning Source Directory DIRECTORY-PATH The directory name is invalid.

OR

Another reason this error to happen was that the invalid name contained "lastSuccessful". That particular job did not have a link "Last successful artifacts" which usually is present on all jobs and is a link to the last successful build artifacts of that job. In one case such a link was missing for whatever reason, and I had to recreate the job and run it in order to make this link appear in the UI of the job in Jenkins.
 

Friday, 16 August 2013

Error 0x8007046A:Not enough server storage is available to process this command.

I was trying to move a 10 GB folder on another network location but this error prevents me from doing it:
 Error 0x8007046A:Not enough server storage is available to process this command.


1. Click Start | Run and type regedit.
2. Locate the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
3. Click Edit and Add Value with the following parameters

Name: MinFreeConnections

Data Type: Reg_DWORD

Decimal: 5

This fixed my problem.

Tuesday, 26 March 2013

Directory-based selection in ANT

To match a pattern of path to resources, use *:

*   matches only the first sub-directory and its content, plus the files of the current dir, no other directories
**  matches all sub-directoryes and their content
   for example, c:\path\to\something\**    will match everything under \something

to include the current dir for file search, start pattern path with **


Matching is done per-directory. This means that first the first directory in the pattern is matched against the first directory in the path to match. Then the second directory is matched, and so on. For example, when we have the pattern /?abc/*/*.java and the path /xabc/foobar/test.java, the first ?abc is matched with xabc, then * is matched with foobar, and finally *.java is matched with test.java. They all match, so the path matches the pattern.
To make things a bit more flexible, we add one extra feature, which makes it possible to match multiple directory levels. This can be used to match a complete directory tree, or a file anywhere in the directory tree. To do this, ** must be used as the name of a directory. When ** is used as the name of a directory in the pattern, it matches zero or more directories. For example: /test/** matches all files/directories under /test/, such as /test/x.java, or /test/foo/bar/xyz.html, but not /xyz.xml.
There is one "shorthand": if a pattern ends with / or \, then ** is appended. For example, mypackage/test/ is interpreted as if it were mypackage/test/**.
Example patterns:
**/CVS/* Matches all files in CVS directories that can be located anywhere in the directory tree.
Matches:
      CVS/Repository
      org/apache/CVS/Entries
      org/apache/jakarta/tools/ant/CVS/Entries
      
But not:
      org/apache/CVS/foo/bar/Entries (foo/bar/
      part does not match)
      
org/apache/jakarta/** Matches all files in the org/apache/jakarta directory tree.
Matches:
      org/apache/jakarta/tools/ant/docs/index.html
      org/apache/jakarta/test.xml
      
But not:
      org/apache/xyz.java
      
(jakarta/ part is missing).
org/apache/**/CVS/* Matches all files in CVS directories that are located anywhere in the directory tree under org/apache.
Matches:
      org/apache/CVS/Entries
      org/apache/jakarta/tools/ant/CVS/Entries
      
But not:
      org/apache/CVS/foo/bar/Entries
      
(foo/bar/ part does not match)
**/test/** Matches all files that have a test element in their path, including test as a filename.

Run command prompt on remote Win machine

Install Sysinternals Process Utilities from:

http://technet.microsoft.com/en-us/sysinternals/bb795533

 PsExec  Execute processes remotely.

The following command launches an interactive command prompt on \\marklap:
psexec \\marklap cmd
This command executes IpConfig on the remote system with the /all switch, and displays the resulting output locally:
psexec \\marklap ipconfig /all
This command copies the program test.exe to the remote system and executes it interactively:
psexec \\marklap -c test.exe
Specify the full path to a program that is already installed on a remote system if its not on the system's path:
psexec \\marklap c:\bin\test.exe

 

Process Explorer Find out which process locks a resource (Find menu), what files, registry keys and other objects processes have open, which DLLs they have loaded

 

Wednesday, 20 March 2013

Linux processes

To find a process

Use pgrep command. pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to screen. For example display firefox process id:
# pgrep firefox
Sample outputs:
3356
 
or
# pidof firefox
3356  
 
Following command will list the process called sshd which is owned by a user called root:
$ pgrep -u root sshd


# ps 3356
Sample outputs:
PID   TTY  STAT   TIME   COMMAND
3356  ?    ..     ..     /path/to/executable
 
pstree shows running processes as a tree.  If a user name is specified, all process trees rooted at processes owned by that user are shown.
$ pstree
 
ps -u user  will show all processes of the user "user"
 $ ps -u user

Thursday, 14 March 2013

VNC server on Linux

Setup VNC server on a Linux machine


Login with the user for which you want to allow remote desktop and enable vncserver startup from System ->Administration->Server Settings->Service configuration
Add the following lines to /etc/sysconfig/vncservers
VNCSERVERS="1:#username#”
VNCSERVERARGS[1]="-geometry 1024x768 -depth 16"
where #username# is the name of the user for which you want to allow remote desktop.
Start and stop VNC server to create the VNC startup file /home/ciuser/.vnc/xstartup
vncserver :1
vncserver -kill :1
The of /home/#username#/.vnc/xstartup must be as follows
#!/bin/sh

vncconfig -iconic &

# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
Copy & Paste the lines above into /home/#username#/.vnc/xstartup where #username# is the name of the user for which you want to allow remote desktop.
 vncserver uses the ports 5901 for display :1, 5902 for display :2, and so on.

The sessions are available on ports 5901 for regular VNC viewers (equivalent to VNC display 1) and on port 5801 for Web browsers. 
For example, in the browser you can access a machine with VNC server running:
http://machineName:5801 
which is equal to using a VNC desktop client, on this one you will use
machineName:5901