Saturday, December 14, 2013

repo for liferay plugins for eclipse

Please add
"Latest Stable Release URL (1.6.x) - http://releases.liferay.com/tools/ide/latest/stable/"
to the addons"

Sunday, November 10, 2013

Compress and scp on the fly

tar cvfz - docs-dm  | ssh joseph@192.168.21.189 "tar zxvf -"

tar cfz - docs-dm  | ssh joseph@192.168.21.189 "tar zxvf -"

Step 1 :- Create a tar file that output to stdout
               tar cf -, the “-” is to output to stdout

Step 2 :- Pipe the output to an ssh connection that execute a command that read stdin and pass it to tar
          tar xvf -, where “-” is stdin.

------------------------------------------------------------------------------------------------
To change the directory and copy

tar cvf - portal-ho/  | ssh joseph@192.168.21.211 'cd /home/joseph/.  && tar xvf -';
 

Sunday, September 29, 2013

Recursively find the latest modified file in a directory

find . -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "
 
%T@ gives you the modification time like a unix timestamp,
sort -n sorts numerically, 
tail -1 takes the last line (highest timestamp), 
cut -f2 -d" " cuts away the first field (the timestamp) from the output. 

Using grep and Ignoring Case (Case Insensitive grep)

grep -i "ErRoR" /opt/alfresco/tomcat/logs/catalina.out > ErrorFile.txt

Sunday, September 22, 2013

how to compress and scp files live

 tar zcvf - ho-dm   | ssh root@192.168.21.189 "cat > /home/joseph/test/ho-dm.tar.gz"

Wednesday, September 18, 2013

"WQS unable to connect to repository: Unauthorized"

Solved the issue of getting message "WQS unable to connect to repository: Unauthorized" for the Document Management
this happens when you change the admin password, the changed password is not getting reflected in some process.
Solution is to
edit "/opt/alfresco/tomcat/shared/classes/alfresco/extension/wqsapi-custom.properties"
and enter the  correct password

ie, if you forget the admin password for a running system with the log message "WQS unable to connect to repository: Unauthorized", then you can get it from "wqsapi-custom.properties"

Sunday, August 4, 2013

Removing commented lines and display

grep -v '^#' samba.conf 
here -v is for inverse 
ie -v, --invert-match
              Invert the sense of matching, to select non-matching lines.
Will print all lines EXCEPT those that begin with a # char. 
you can change the comment char to whatever you wish.
 
egrep -v '^(;|#|//)' filelist 
If you have more than one comment char , use the above command 
 
 
In regex, ^ indicates the beginning of a line, and $ the end of a line,
So ^$ specifies lines where the start of line character and the end of line character are right next to each other.
 

Friday, May 31, 2013

Vocablary

May 31'st
------------------
moribund :-
(especially of an organization or business) not active or successful:
How can the Trade Department be revived from its present moribund state?

witless:-
› stupid or showing no intelligence:
 The novel centres around a witless father who is continually being conned by his three children.

naive:-
too willing to believe that someone is telling the truth, that people's intentions in general are good, or that life is simple and fair.
People are often naive because they are young and/or have not had much experience of life:
She was very naive to believe that he'd stay with her. They make the naive assumption that because it's popular it must be good.
It was a little naive of you to think that they would listen to your suggestions. naively (also naïvely)
 I, perhaps naively, believed he was telling the truth

absurd:-
B2 stupid and unreasonable, or silly in a humorous way:
What an absurd thing to say! Don't be so absurd! Of course I want you to come.
It's an absurd situation - neither of them will talk to the other.
 Do I look absurd in this hat? the absurd
› things that happen that are stupid or unreasonable:
 The whole situation borders on the absurd.
 She has a keen sense of the absurd. absurdly
 adverb › You're behaving absurdly. It was absurdly expensive.

hag:-
an ugly old woman

immutable:-
not changing, or unable to be changed:
an immutable law Some people regard grammar as an immutable set of rules.

reckon:-
to think or believe:
I reckon it's going to rain. [+ (that)] How much do you reckon (that) it's going to cost? "Can you fix my car today?" "I reckon not/so (= probably not/probably)."

aisle:-
a long, narrow space between rows of seats in an aircraft, cinema, or church:
 Would you like an aisle seat or would you prefer to be by the window?
 › a long, narrow space between the rows of shelves in a large shop:
 You'll find the shampoo and the soap in the fourth aisle along from the entrance.

bloke:-
a man, often one who is considered to be ordinary:
Paul's a really good bloke (= I like him a lot).
 He's a funny (sort of) bloke (= slightly strange).

bandy:-
(of legs) bending out at the knees:
I couldn't help laughing at his bandy legs.

errand:-
a short journey either to take a message or to take or collect something:
I'll meet you at six, I've got some errands to do/run first.

squiffy:-
› slightly drunk:
 "I've only had one glass of sherry and I feel squiffy already," she said.





















Sunday, May 26, 2013

SSH Automatic Login

SSH Automatic Login

Here are the steps:

    Create a public ssh key, if you haven’t one already.
    Look at ~/.ssh. If you see a file named id_dsa.pub then you obviously already have a public key. If not, simply create one. ssh-keygen -t dsa should do the trick.
    Please note that there are other types of keys, e.g. RSA instead of DSA. I simply recomend DSA, but keep that in mind if you run into errors.
    Make sure your .ssh dir is 700:
    chmod 700 ~/.ssh
    Get your public ssh key on the server you want to login automatically.
    A simple scp ~/.ssh/id_dsa.pub remoteuser@remoteserver.com: is ok.
    Append the contents of your public key to the ~/.ssh/authorized_keys and remove it.
    Important: This must be done on the server you just copied your public key to. Otherwise you wouldn’t have had to copy it on your server.
    Simply issue something like cat id_dsa.pub > .ssh/authorized_keys while at your home directory.
    Instead of steps 3 and 4, you can issue something like this:
    cat ~/.ssh/id_dsa.pub | ssh -l remoteuser remoteserver.com 'cat >  ~/.ssh/authorized_keys'
    Remove your public key from the home directory on the server.
    Done!
Also check the permission of .ssh/authorized_keys it should be "600", otherwise it will not work
    You can now login:
    ssh -l remoteuser remoteserver.com or ssh remoteuser@remoteserver.com without getting asked for a password.

That’s all you need to do.

#############
All in one step

ssh-keygen -t rsa

cat ~/.ssh/id_dsa.pub | ssh -l remoteuser remoteserver.com 'cat >> ~/.ssh/authorized_keys'

cat ~/.ssh/id_dsa.pub | ssh -l joseph 192.168.20.15 'cat >> ~/.ssh/authorized_keys'
cat ~/.ssh/id_dsa.pub | ssh -l joseph 192.168.21.164 'cat >> ~/.ssh/authorized_keys'
 
     or

cat ~/.ssh/id_rsa.pub | ssh -l joseph 192.168.20.15 'cat >> ~/.ssh/authorized_keys'

cat ~/.ssh/id_rsa.pub | ssh -l dmbackup 192.168.20.17 'cat >> ~/.ssh/authorized_keys'

cat ~/.ssh/id_rsa.pub | ssh -l dmbackup 128.52.1.15 'cat >> ~/.ssh/authorized_keys'

rsync notes


rsync
  commands to execute rsync is

Points to be careful with when using Rsync?
  • Be careful with the --delete command. If your using a source dir that is not mounted (nfs,cifs,etc) but the mount for the dir is still there then you will sync your blank dir. All remote files will be deleted.
  • Be careful with slashes after the dir names on the source. A slash after the dir name compared to no slash after the dir name will do 2 totally different things.
Difference in giving "/"
What if we  wanted to not just copy all of the files under /sourcedisk/, but also the /sourcedisk/ directory name. Just leave off the last "/" after the "/sourcedisk" directory name. This will tell rsync to copy the directory name and all files under that directory. On the remote server you will then see the directory structure /backups/sourcedisk/.

To reflect the deleted files to be removed from the destination


-r => recurse into directories
-a => archive
-v => increase verbosity
-z => compress file during transfer


this will copy the "Project" Folder entirely to remote server /home/joseph



This will copy the contents of "Project" to the remote server /home/joseph. ie you will not have folder "Project" in remote server, but you will see the contents of it in /home/joseph/

Thursday, May 23, 2013


This is done for alfresco 4.2.c (which has java 7) (a) Install AMP java -jar /opt/alfresco/bin/alfresco-mmt.jar install /home/urname/Downloads/ABR/alfresco-business-reporting-explorer-0.8.0.1.amp /opt/alfresco/tomcat/webapps/share.war -verbose (b) copy the the jar file ie "alfresco-business-reporting-share-0.8.0.1.jar" to /opt/alfresco/tomcat/shared/lib/ (c) create DB as given instruction in http://code.google.com/p/alfresco-business-reporting/wiki/Home#Create_your_Reporting_database (c) For Alfresco CE 4.2.c , create alfresco.xml in "/opt/alfresco/tomcat/conf/Catalina/localhost/" with the following lines />

VI editor TIPS

Globally search and replace 

Tuesday, May 21, 2013

Using Tar and SSH to improve SCP Speeds

tar czf - www.example.com/ | ssh joebloggs@otherserver.com tar xzf - -C ~/

Sunday, May 19, 2013

Checking internet speed from command line


We need to download the repository from "speedtest-cli.git", if u do not have git, please install it

Now we have to clone the repo

To make it available copy the binary to /bin/

Tuesday, May 14, 2013

location of "portal-ext.properties"

The location of "portal-ext.properties" is at
/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes

Sunday, May 12, 2013

WARN : org.alfresco.wcm.client.util.impl.GuestSessionFactoryImpl - WQS unable to connect to repository: Unauthorized

This message is because of the password or  user name has not been updated in

/opt/alfresco/tomcat/shared/classes/alfresco/extension/wqsapi-custom.properties

Edit and update the file, the message will be gone

Thursday, May 2, 2013

installing AMP in alfresco

By verbose
By force

Tuesday, April 2, 2013

Searching for the process and killing it


-e    Select all processes.
-f     Does full-format listing.
-------------------------------------------------
grep -v
       -v, --invert-match
              Invert the sense of matching, to select non-matching lines.

Sunday, March 17, 2013

mounting CIFS on the Alfresco Server itself




Tuesday, March 12, 2013

IPTABLES :- Open Up Remote Ports

iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
 
# The above line accept connection to port 3306
 

To see which ports are being used

netstat -ntl
 
-n = Numeric 
-t = 
-l =  interface

Redirect to a different port using IPTABLES

 iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 

-t = table 

-A = Appending 

PREROUTING:- Is the chain which is responsible for packets that just arrived at the network interface
So far no routing decision has taken place, therefore it is not yet known whether the packet would be interpreted locally or whether it would be forwarded to another machine located at another network interface. After the packet has passed the PREROUTING chain the routing decision is made.


-p = protocol

--dport = destination port 

-j =  
 -j, --jump target
This specifies the target of the rule; i.e., what to do if the packet matches it.  The  target  can  be  a  user-defined  chain  (other than the one this rule is in).


--to-port
--to-ports port[-port]
              This specifies a destination port or range of ports to use: without this, the destination port is never altered.  This is  only valid if the rule also specifies -p tcp or -p udp.
 

Test it by 
iptables -t nat -L

to check which port is used
netstat -ntl
 

 
Note:-
The chains PREROUTING und POSTROUTING are the most important ones. As the name implies, the PREROUTING chain is responsible for packets that just arrived at the network interface. So far no routing decision has taken place, therefore it is not yet known whether the packet would be interpreted locally or whether it would be forwarded to another machine located at another network interface. After the packet has passed the PREROUTING chain the routing decision is made

Sunday, March 10, 2013

mysql root password change

/usr/bin/mysqladmin -u root password 'new-password'

to make it more secure
run "/usr/bin/mysql_secure_installation"

Saturday, March 2, 2013

checking out Ubuntu version

  • cat /etc/issue
  • cat /etc/issue.net
  • cat /etc/lsb-release
  • cat /etc/debian_version

  • lsb_release -a

Wednesday, February 27, 2013

Liferay, by passing the password reset and secret question

Add the following in  "/webapps/ROOT/WEB-INF/classes/portal-ext.properties"

users.reminder.queries.enabled=false
users.reminder.queries.custom.question.enabled=false

Monday, February 11, 2013

synergy starting using logs

/usr/bin/synergys -c /etc/synergy.conf -l /synergyS.log -f
 
-f will allow you to see real time what is going on, the log file can be your permanent reference. 

Thursday, January 31, 2013

Alfresco how to make change in CSS acitve without restarting ALfresco

Go to WebScript Home Console (/share/page/index)
 then click on the "Clear Dependency Caches" button at the lower part of
the page.

Enabling SURF bug in Alfresco

Go to "http://IPaddress:8080/share/page/surfBugStatus