Thursday, December 13, 2012

GIT for beginners (and me)

Starting working with GIT ( I'm currently using SVN and I used in the past ClearCase rip) .
Here are some useful commands :

  • git init    - for initializing the .git/  repository in your current directory
  • git status -  return which files should be committed etc ...
  • git add  - mark files for the repository , so you remember to commit them later on. Those file will become candidate for commit
  • git add \*.java  - will add recursively ALL the java files 
  • git commit -m "My comment about this commit"  - obvious
  • git branch -b BranchName  - switch to the BranchName branch
  • git checkout -b NewBranchName  - copy your current branch into another NewBranchName
  • git branch - show all your defined branches and indicate what is your current branch
  • git reset --hard HEAD  - revert to the HEAD version, overwirting any local change (hard)
  • git merge show_michael  (didn't use it yet)
Here are some good links (as it seems to me now that some bullet in my summary are incorrect)


Another tutorial suggested to me today :
http://pcottle.github.io/learnGitBranching/

And some interesting procedure for working with SVN while working with git:


git stash list  
git stash drop     <<== Delete stash
git stash list  
git status
git stash       <<== save in a stash backup all the dirty files (the one that were not committed. but not the ones which are not yet added only to git )
git stash list
git status
git checkout master   <<== go to master , when your current branch is clean (no stash anymore)
svn update    <<= update with SVN
git status
git add .       <<= this is the quick way to get it all your svn update to your git
git status
git commit -m "svn update"  
git status
git checkout oauth  <<== return back to your working branch 
git status
git merge master oauth  <<== merge, for getting all the SVN update (but using git now)
git status
git stash apply  <<== retrieve the stash dirty files ... 
git status
history

Monday, November 19, 2012

How to synchronize clock between time

In order to synchronize the clock time between servers, you must have one reference server. In our example tlvntp1.tlv.lpnet.com
Then, all your server should refer to it . That's the way to do it:

1) In your file /etc/ntp.conf, you should have the following line:

server tlvntp1.tlv.lpnet.com
My System Administrator did the following shortcut:
echo server tlvntp1.tlv.lpnet.com > /etc/ntp.conf

But be careful with it, since it may delete other synchronization option the file already has.


2) To be synchronized with our IT ntpserver (the one with the good clock time)
service ntpd restart

3) Then ntpq -p
to display what the offset with the synchronized server  (the tlvntp1) 
The offset should reduce after few minutes ....

This apparently means what is the offset between your current server and the referenced ntp server ( here, for ex, rstm02 and rstm18 etc ...)
michaelz@roor-wto128:~$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+rstm02.lpdomain 64.236.96.53     2 u  162 1024  377    0.320    4.600   0.049
+rstm18.lpdomain 204.9.54.119     2 u  150 1024  377    0.337    5.579   0.063
*rstm09.lpdomain 64.236.96.53     2 u  173 1024  377    0.358    1.196   0.035
 rstm07.lpdomain 172.16.22.71     2 u  551 1024  377    0.777  -42.128   3.369
 rstm06.lpdomain 172.16.22.71     2 u  884 1024  377    2.675  -94.770  96.884


Same, but without host name resolving (-n option)
michaelz@roor-wto128:~$ ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+10.16.23.11     64.236.96.53     2 u  168 1024  377    0.320    4.600   0.049
+10.16.22.18     204.9.54.119     2 u  156 1024  377    0.337    5.579   0.063
*10.16.23.21     64.236.96.53     2 u  179 1024  377    0.358    1.196   0.035
 10.16.22.61     172.16.22.71     2 u  557 1024  377    0.777  -42.128   3.369
 10.16.22.71     172.16.22.71     2 u  890 1024  377    2.675  -94.770  96.884


4) Synchronize time between two servers
In order to synchronize the time between two different servers (no need to have an ntp server in between):

ntpdate -u the-second-host-server





To synchronize your Windows with an external NTP server, do the following:
net time \\tlvdc1 /set /y    
where, tlvdc1 is the host  name of yoru NTP server

Monday, October 29, 2012

Change background color in linux/unix terminal xterm

 Useful link for modifying the background color.
Especially useful when working with multiple terminal, on different machines ...


http://unix.stackexchange.com/questions/16120/in-bash-how-can-i-change-the-color-of-my-command-prompt

Put in your ~/.bashrc

# Color mapping
grey='\[\033[1;30m\]'
red='\[\033[0;31m\]'
RED='\[\033[1;31m\]'
green='\[\033[0;32m\]'
GREEN='\[\033[1;32m\]'
yellow='\[\033[0;33m\]'
YELLOW='\[\033[1;33m\]'
purple='\[\033[0;35m\]'
PURPLE='\[\033[1;35m\]'
white='\[\033[0;37m\]'
WHITE='\[\033[1;37m\]'
blue='\[\033[0;34m\]'
BLUE='\[\033[1;34m\]'
cyan='\[\033[0;36m\]'
CYAN='\[\033[1;36m\]'
NC='\[\033[0m\]'
Step 2. Re-define your PS1 variable:
PS1="$yellow[$CYAN\t$yellow][$red\H$yellow][$GREEN\w$grey$yellow]$NC# "
 
 
 or more details also can be found here:
 
https://wiki.archlinux.org/index.php/Color_Bash_Prompt
 

Prompt escapes

The various Bash prompt escapes listed in the manpage:
Bash allows these prompt strings to be customized by inserting a number of backslash-escaped special characters that are decoded as follows: \a an ASCII bell character (07) \d the date in "Weekday Month Date" format (e.g., "Tue May 26") \D{format} the format is passed to strftime(3) and the result is inserted into the prompt string an empty format results in a locale-specific time representation. The braces are required \e an ASCII escape character (033) \h the hostname up to the first `.' \H the hostname \j the number of jobs currently managed by the shell \l the basename of the shell's terminal device name \n newline \r carriage return \s the name of the shell, the basename of $0 (the portion following the final slash) \t the current time in 24-hour HH:MM:SS format \T the current time in 12-hour HH:MM:SS format \@ the current time in 12-hour am/pm format \A the current time in 24-hour HH:MM format \u the username of the current user \v the version of bash (e.g., 2.00) \V the release of bash, version + patch level (e.g., 2.00.0) \w the current working directory, with $HOME abbreviated with a tilde \W the basename of the current working directory, with $HOME abbreviated with a tilde \! the history number of this command \# the command number of this command \$ if the effective UID is 0, a #, otherwise a $ \nnn the character corresponding to the octal number nnn \\ a backslash \[ begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt \] end a sequence of non-printing characters
 

Thursday, September 13, 2012

XMing + Putty for remote desktop on ubuntu

Well, I didn't work with Remote Desktop but I was told (Omri) that I can work instead with specific remote application, using XMing + Putty.

Explanation there:
http://www.math.umn.edu/systems_guide/putty_xwin32.html


In few word, start XMing server.
Then, run putty and configure your SSH session to your remote desktop / ubuntu use X-Forwarding.

Then, the putty console can open XTerm and all other graphics ...

Sunday, July 1, 2012

Connect to jconsole to a remote server

Recently, I've encountered problem for connecting jconsole to my remote server (it was tomcat server). Locally, it did work but remotely, it didn't,
I used JDK 1.7 (it may be linked ... ) and ubuntu (it may be linked also).

So I've added the following property:
-Djava.rmi.server.hostname=michael-ubu 


and it started working ...

Here's the doc that finally helped me:

http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/javarmiproperties.html


java.rmi.server.hostname
The value of this property represents the host name string that should be associated with remote stubs for locally created remote objects, in order to allow clients to invoke methods on the remote object. The default value of this property is the IP address of the local host, in "dotted-quad" format.






This one also helped me:

I had a similar, if not the same, problem. I could connect to the JMX server if I started jconsole locally on the machine.
It appears the RMI server was not listening on the correct ip. So, as was suggested in this related question, I added the following:
-Djava.rmi.server.hostname=<host ip>
to JAVA_OPTS as well, and then it worked.



Sunday, June 10, 2012

Remote desktop to Ubuntu

I struggle a lit for accessing my Ubuntu desktop from a windows computer.
I use team viewer which gives a full solution, that overcomes the con security wall .
But I also discovered recently the realvnc viewer, which is quite fast and precise, and requires only a simple executable without installation.

Monday, June 4, 2012

Ubuntu linux Remove Global AppMenu

In order to remove the Global AppMenu on the top screen and have the window standard app menu on the top of each window, do the following:

sudo apt-get remove indicator-appmenu


There's also way to remove the global menu for specific application only (i.e only for firefox , idea etc ...)

Thursday, May 24, 2012

IDEA JetBrain intellij

I started using IDEA instead of eclipse ...
First impressions:
I don't like their GUI
I do like their integration with spring/tomcat/everything ...
I do like the fastness in search ...

Some tip for newbies and for ubuntu / linux user:

1) when clicking on Switch-Tab for moving between application, I don't see the IDEA icon.
Solution: http://devnet.jetbrains.net/thread/435242


intellij-launcher.png

Please remove your launcher, start IDEA from a terminal, invoke a Tools | Create Desktop Entry action, exit IDEA, and restart session. After that you'll have a correct main menu entry which displays right icon in a switcher and is pinnable to Unity launcher.






2) Good link for better navigation in IDEA:

like here:

Quick switch of the current scheme

screenshot
There is no need to dig deep into the settings dialogs hierarchy when you need to apply another Color/Code style Scheme, Keymap or even Look and Feel of the application. This can be achieved with a short series of shortcuts. Just press Ctrl + BackQuote and then the number of the scheme to change.

Tuesday, May 22, 2012

Ubuntu background color problem

Periodically, when upgrading Ubuntu, I have this background color problem, where for ex my eclipse open popup with a black color background, so I can't read the tooltip content.

I found a solution here.
In my words:

go to /usr/share/themes/Ambiance/gtk-2.0/gtkrc 
and replace #000000 by #f5f5b5

http://askubuntu.com/questions/70599/how-to-change-tooltip-background-color-in-unity


I had to edit these files:
/usr/share/themes/Ambiance/gtk-3.0/settings.ini
/usr/share/themes/Ambiance/gtk-3.0/gtk.css
/usr/share/themes/Ambiance/gtk-2.0/gtkrc
(Addition: for Ubuntu 12.04, it seems youjust have to modify the file: /usr/share/themes/Ambiance/gtk-2.0/gtkrc , replacing the tooltip backround and foreground color, with the #000000 and the #f5f5b5 color, respectively)
You require root privileges to edit the files. Use sudo gedit to edit them.
Search for tooltip in these files and you'll find the color definitions for the foreground and the background. I use #000000 as foreground and #f5f5b5 as background and now the tooltips in all applications are again readable. After changing the color values simply switch to some other theme and then back to Ambiance and the tooltip color is now fixed.


Thursday, May 17, 2012

VirtualBox VM for linux

I'm using VirtualBox for emulating linux (Centos or Ubuntu).

When creating new VM,  in order to have an external IP:

Click on VM/Settings (when the machine is off ... otherwise, the Setting option is not available)
Network and select Bridged Adapter / etho / Allow All






Then, run the on the VM
ifconfig -a 
in order to see which network card is used . For ex , here we use eth0:



eth0      Link encap:Ethernet  HWaddr 08:2e:5f:32:c6:2b
          inet addr:192.168.23.148  Bcast:192.168.23.255  Mask:255.255.252.0          inet6 addr: fe80::a2e:5fff:fe32:c62b/64 Scope:Link          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:1148454 errors:0 dropped:304 overruns:0 frame:0          TX packets:57473 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000          RX bytes:169648034 (169.6 MB)  TX bytes:9345047 (9.3 MB)          Interrupt:19
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Host          UP LOOPBACK RUNNING  MTU:16436  Metric:1          RX packets:107277 errors:0 dropped:0 overruns:0 frame:0          TX packets:107277 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:0          RX bytes:70365858 (70.3 MB)  TX bytes:70365858 (70.3 MB)



Then, run the  dhcpClient in order to make the VM get a new IP address.
dhclient eth0 

In order to get this dhcpClient run after each reboot, go to the file
/etc/sysconfig/network-scripts/ifcfg-eth0

and edit it with the following:


DEVICE="eth0"
NM_CONTROLLED="no"
BOOTPROTO="dhcp"
ONBOOT="yes"




Then, ensure you don't have firewall blocking the connection to this new IP

# service iptables save
# service iptables stop
# chkconfig iptables off

In order to give the new VM a permanent hostname  :

go to file /etc/sysconfig/network
and modify the line:
HOSTNAME=your-vm-desired-name




thanks to http://servercomputing.blogspot.co.il/2011/12/change-redhat-centos-hostname.html 

Once done, I suggest to add this hostname to the /etc/hosts:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.14.183  your-vm-desired-name


Somehow, my VM centos image didn't include some basic linux centos package.
So here they are:
  •  yum install redhat-lsb
  •  yum install openssh-clients

ReAssign MAC Address

If you decide to assign a new MAC address to your VM (if you clone it, for example), then do not forget to assign it a new external IP by doing the following:

remove content of
/etc/udev/rules.d/70-persisten-net.rules

Then , just reboot your VM machine

This file associates the network card (like eth0, eth1 etc) to the MAC address.

Wednesday, May 16, 2012

Linux tip

I have two monitors and since Ubuntu version 12.04, moving windows from one monitor to the other became 'harder' (well, it's better than before, where moving from one monitor to the other was too easy).
So, I've wrote some script for moving window or mouse cursor from one side to the other:

my script look as following:


file /home/michaelz/util/move-window-to-display.sh
#!/bin/bash
# Copied and inspired from  http://ubuntuforums.org/showthread.php?t=1414155
if [ $1 -eq 2 ]
then
    POS="1700 0"
else
    POS="0 0"
fi
/usr/bin/xdotool windowmove `/usr/bin/xdotool getwindowfocus` $POS
exit 0

I just added to add a Custom Shortcut to my keyboard ( Keyboard / Add Custom) to this script like:


for moving to the left monitor
/home/michaelz/util/move-window-to-display.sh 1 
for moving to the right  monitor (or vice-versa)
/home/michaelz/util/move-window-to-display.sh 2 


For moving my cursor:
To the left:
xdotool mousemove 0 20
To the right:
xdotool mousemove 2000 20


Monday, April 23, 2012

AlphaCSP the Edge 2012 conference

Tim Berglund, the first speaker (about how tech architecture shapes us)

First, we shape the building. Then, the building shapes us (W. Churchill)

Technologies qui montent
groovy
jruby
jython
scala


Embrace Constraints

There's never enough to go around. Not enough time. Not enough money. Not enough people.
That's a good thing.
Instead of freaking out about these constraints, embrace them. Let them guide you. Constraints drive innovation and force focus. Instead of trying to remove them, use them to your advantage.


SCALA DSL by Julian Dragus

Woman is not a man
Simply scale blog - scala for java regugees  


Spring lecture

3.1 version major theme: 
  • profile
  • no more need for web.xml
  • high level cache
Environment before 3.1:
<bean profile="testing" />
in XML
< bean profile="dev" etc ... />

In java
@configuration
@profile="dev"
public class AppConfig ...

@Service
@Profile
pubic class UserService

check it later:
should considerate (but he may be wrong, according to victor), considerate using java instead of XML in order to create the bean config

How to activate (3 ways):
  • java -Dspring.profiles.active="profile1,profile2" 
  • ctx.getEnvironment().setActiveProfile()
  •  in your unit test@ActiveProfile("dev")
    @Test 

Other suggestion for using programmatically profile (as opposed to configuration)

Retrieve profile using interface
@profile("dev"
interface Dev

then, use your anntotation of your profile:
@dev 
public class etc ...


Cache API
@cacheable
public Book find(bookname)

@cacheEvict(value="book"
for deleting book from the cache

key : we can decide which key will be used

@cahceable(value="book" condition =@namelength>20) 

use condition for telling caceh of spring whether we want to cache the book or not

Default simple implementation:
Simple CacheManager  (in memory)
NOOpCacheManager (no real cache, nothing is stored)
EhCacheCacheManager 

run it using


Servlet 3.0
async servlet but also no more need to use web.xml

Incode define
WebAppInitializer
onStartup
addServlet()
addFilters()


Spring mobile : wurfle for getting info about device
Spring social - button for login through facebook , twitter

Security Spring
Then, we can decide if user is authorized to view certain URL ...

Disruptor lecture

 see blog Thompson, Trisha Gee video

Debugger Time Travelling debugger

He used prezi (http://prezi.com/ ) for the presentation, which was apparently very good)

Cassandra lecture

add value with HP
increment by 1 support by server
Hector (Ran Tavori) for cassandra client lib
IRC #cassandra on freenode
github

Akka : actor on JVM , is scala based
Check it : lambda.org.il  , meet once a month

Have a look:
graylog, elastic search. May be used for distributed log.
check it for log4j log view
Gelf appender


drool fusion: 
gelfino , logstack
JRebel vs HotSwap
Mockito: for unit test

Wednesday, February 1, 2012

Diagram tool for free

Links from Dan Bar Shalom :

Very nice online diagram tool:
http://www.diagram.ly/

Unlike all the others it is:
1. Completely free
2. You can save diagrams to images or local xml files on your disk that you can later load back
3. No registration or login needed.


Another tool that someone already posted somewhere in nation:
http://www.websequencediagrams.com/

You can create web sequence diagrams and save them as images.
You can also save the text and load it later.

Tuesday, January 17, 2012

SVN tutorial

Some SVN command line help tutorial ...

It was copied from http://www.yolinux.com/TUTORIALS/Subversion.html#COMMAND


Subversion Introduction:

Subversion is a software source code "Change Management" (CM) system for collaborative development. It maintains a history of file and directory versions. The files and directories are checked out of the repository and into your local project work area. This called your "working directory". Changes are made to files in your "working directory". After changes are made to the create the next working version, the files are checked into the Subversion CM repository.


Subversion Commands:
Subversion command summary cheat sheet:

CommandDescription
svn --helpList Subversion commands
svn help command
Also: ? or h
Help on given "command"
svn add filename

svn add directory

Add a file or directory to Subversion CM control.
Must also perform: svn ci filename (or svn commit) to upload the file or directory. File will not be available in the repository until a "commit" is performed. If adding a directory, the directory and all of its contents recursively are added. i.e.:
svn ci directory
svn commit directory
svn commit .
svn blame filename
svn blame -r RevisionNumber filename
Also: praise, annotate, ann
Show file contents with revisions annotated with author information.
svn cat filenameList contents of file under Subversion control.
svn checkout http://node-name/repos/svn/trunk/parentPath/path
This creates:
path/file1
path/file2
...

svn checkout http://node-name/repos/svn/trunk/parentPath .
This creates:
path/file1
path/file2
...
Note the difference a "." makes.

svn checkout file:///repos/svn/trunk/path/
svn co -r 497 http://node-name/repos/svn/trunk/path file-name
Also: svn co https://..., svn://..., and svn+ssh://
MS/Windows: svn co file:///c:/repository/project/trunk

Checkout every file from the path and subdirectories specified below. Creates "working" copy of files and directories.
Checkout a repository.

Use option "-r" to specify a specific revision other than the latest.

The URL "svn://" communicates with an SVN server (port 3690)

The URL "http://" comunicates with the Apache server and module mod_dav_svn(port 80) [more common server]

svn cleanupCleanup subversion files resulting from escaped processes and crashed.
svn commit filename
svn commit --message "Message goes here." filename
svn commit -m "Message goes here." filename
svn ci filename1 filename2 filename3
svn ci .
Check-in (commit) local "working" file, files or directory and contents (recursively) into Subversion repository. Atomic, i.e. all committed or none, no incomplete check-in.
svn copy source destination_clone
Also: svn cp ...
Copy file or directory tree. One can copy from one local working copy to another or to repository server URL's. The sources and destinations can be working copies or URLs.
svn copy http://host/repos/project/trunk http://host/repos/project/tags/TagName-1.4.5 -m "Tag Release 1.4.5"Tag a release. Takes a snapshot of the repository and assigns a name. This can be performed at any directory branch.
svn copy . http://host/repos/project/tags/TagName-1.4.5 -m "Tag Release 1.4.5"Tag a release. Takes a snapshot of your local working copy and assigns a name. This can be performed at any directory branch.
svn delete filename
svn delete directory
Also: del, remove or rm
svn rm http://host/repos/project/trunk/file-or-directory
Delete file from repository. The UNIX command rm file-name. Must perform a "commit" to update the repository and local working directory with the changes. i.e.:
svn commit .
svn diff filename
svn di filename
Show file diffs between SVN repository and your file changes using GNU file diff format. Use GUI diff tools as shown below.
svn diff -r rev1:rev2 filenameShow file diffs between specified versions.
Example: svn diff -r 456:459 subfn.cpp
Using GUI diff tool: svn diff -r 457:459 --diff-cmd kdiff3 file-name
svn diff filename > patch-fileGenerate patch file used by the patch command.
svn export directoryExport directory tree to your file system but it will not be a "working directory" under SVN control.
svn export -r Rev-Number http://node-name/pathExport directory tree of specified version and create local directory tree and files not under SVN control.
svn import local-directory http://node/repos/svn/trunk/directoryAdd directory (and files in it recursively) to path in repository specified.
svn info filenameDisplay information about file or directory. (Date modified, author, revision, path in repository.)
Can not specify a URL.
svn list directory
svn list file-name
List file or directory of files in repository. Used to browse repository before checkout. If current directory is given (svn list ./), then Subversion will list the repository URL of the current directory.
svn list -r RevisionNumber directoryList directory of files in repository in specified revision.
svn lock filename -m "comment as to why its locked or by whom"

(Comment is not required but is often useful)
Lock file to grant exclusive access to one and forbid all others. A commit will unlock the file (unless the "--no-unlock" option is used). A lock can be removed with the commands: svn unlock filename, svnlook and the svnadmin comands (i.e. List: svnadmin lslocks and remove: svnadmin rmlocks filename).
svn log filename
svn log .
svn log http://URL/path/file
svn log -v .
svn log -r RevisionNumber http://URL/path/file
Show the Subversion log messages for a set of revision(s) and/or file(s) and/or all directory contents in repository.
List verbose. Includes list of all files in change
Shows the file changes associated with revision number.
svn merge http://url/path/branch1 http://url/path/branch2 working-local-dir
svn merge file1@revJ file2@revK
svn merge -r 414:411 http://url/path working-dir
svn merge -r 413:HEAD file-name
Merge directory changes into your current working directory or merge a file in Subversion into the file in your working directory. If target is not specified, the identical basename or current directory is assumed. Used to incorporate changes checked in which are not accounted for in your file or to merge branches.
Example using GUI merge tool:
svn diff -r 459:454 --diff-cmd kdiff3 --extensions '-m' file-name
Next, tell subversion that the conflicts have been resolved:
svn resolve file-name
Finally, check-in file: svn ci file-name
or abort changes: svn revert file-name
svn merge --dry-run -r 414:413 http://url/pathTest merge. No changes are made to your local working copy but shows Subversion feedback as if merge was performed.
svn merge -r 414:413 http://url/path
svn merge -r 414:413 .
Undo changes committed in revision 414.
svn mkdir directory
svn mkdir http://URL/directory
Create a new directory under version control.
svn move directory1 directory2
svn mv directory1 directory2
svn mv file-old-name file-new-name
Rename or move a file or directory. Moves/renames file/directory in repository and in local work area.
Must perform svn ci file-new-name after the move for changes to to take place in repository.
svn revert filenameUndo changes in local work files. Throw away local changes.
svn resolved filenameRun this command after resolving merge conflicts. Next "commit" your changes.
svn status
svn status -u
svn status -u .
svn status -uq .
Show status of file changes in current directory and recursively in directories below.
Show out of date file info: svn status --show-updates
(equivalent: svn status -u)
-u: Determines status by comparing your local repository with the server repository. Without this option, the status shown will only be the changes you have made in your local repository.

-q: Quiet. Do not print "?: File/directory not under version control" or "!: File/directory missing" extraneous information.

First collumn:

  • A: File to be added
  • C: Conflicting changes
  • D: File to be deleted
  • G: File to be merged with updates from server
  • M: File has been modified
  • R: File to be replaced
  • G: File to be merged
  • X: Resource is external to repository (svn:externals)
  • ?: File/directory not under version control
  • !: File/directory missing
  • ~: Versioned item obstructed by some item of a different kind.
Second collumn: Modification of properties
  • ' ' no modifications. Working copy is up to date.
  • 'C' Conflicted
  • 'M' Modified
  • '*' Local file different than repository. A newer revision exists on the server. Update will result in merge or possible conflict.
  • Third collumn: Locks
    • ' ' not locked
    • 'L' locked
    • 'S' switched to a branch
svn switch http://server/new-branch
svn switch --relocate http://server/old-path http://server/new-path
Switch your local working copy to mirror a new repository branch instead of main trunk or previous branch. Also allows you to point your repository to a new path on the server if the server path changes since you performed a check-out.
svn update
svn update filename
svn update -r458 filename
svn update --ignore-externals ./
Migrate all updates from Subversion repository to your local copy (recusively for all files in the current directory and all below it). If there have been updates to the svn repository since you downloaded the files, subversion will give you the opportunity to merge. Status of files will use the coding as stated above for "status". Files marked with a "C" (conflict) should be merged of reverted. If merged then one can perform a "resolve" and then a "check-in".
If a file name is specified, only that file is updated.
Can also syncronize to a specified revision given by -r.
Use --ignore-externals to avoid the slow processing of externals to a potentially slow distant internet server.

Where RevisionNumber is:

  • HEAD: The latest revision in the repository.
  • BASE: The "pristine" revision of an item in a working copy. Matches checked out version before any modifications.
  • COMMITTED: The last revision in which an item changed before (or at) BASE.
  • PREV: The revision just before the last revision in which an item changed. (Technically, COMMITTED - 1.)

Sunday, January 15, 2012

Ubuntu

Wonderful world of ubuntu!

Find files related to an application you've installed:
dpkg -L (example dpkg -L tomcat7-examples)
Find package you've installed :
apt-cache search tomcat7

For getting list of port being used by your server:
netstat -ntlp 

looking for 
apt-get search tomcat


For disabling firewall


# service iptables save
# service iptables stop
# chkconfig iptables off

http://www.cyberciti.biz/faq/disable-linux-firewall-under-centos-rhel

In order to change name of your host server in ubuntu:

1) edit /etc/hosts
192.162.23.116 youNewName

2) sudo hostname yourNewName

3) Unclear if it's really required:
/etc/hostname
==> yourNewName

Notice: this change will be overwritten after reboot ... Dont know how to make the change permanent.


Mount Windows folder 

    1. First, edit your /etc/hosts file and give the Windows machine a name you want to mount from: 192.168.1.2   pootie
    2. Next, install the samba and smbfs packages using your method of choice. (e.g. synaptic || Ubuntu software center) Create a directory where the share will appear on your local filesystem. $ sudo mkdir /mnt/music
    3. Edit /etc/fstab and add a line for the mount. Here "pootie" is the name of the machine and "music" is the name of the share.//pootie/music  /mnt/music  cifs exec,credentials=/etc/cifspw 0 0
    4. Create a password file /etc/cifspw with the login credentials for your Windows account. (if your windows account is going to change you'll need tp change that either):username=Jason
      password=ImNotGonnaTellYouThat
    5. And secure the file: $ sudo chmod 600 /etc/cifspw
    6. then excute the followed: $ sudo mount -a