January 21, 2014 0

Couchbase community 2 – rebalance “BUG”

By in Linux

So I found this error when trying to execute the following command;

/opt/couchbase/bin/couchbase-cli rebalance -c –server-add= -uAdministrator -psomepassword

ERROR: unable to server-add (400) Bad Request
[u'Prepare join failed. Authentication failed. Verify username and password. Got HTTP status 401 from REST call post to Body was: []‘]

This was working fine with previous versions, so I found the “BUG”:


So from now on we need to add –server-add-username=  –server-add-password= , they are usual the same as the cluster credentials.

Working command:

/opt/couchbase/bin/couchbase-cli rebalance -c –server-add= -uAdministrator -psomepassword –server-add-username=Administrator  –server-add-password=somepassword

SUCCESS: server-add
INFO: rebalancing .
SUCCESS: rebalanced cluster

I hope this will help someone!

Tags: , ,

December 12, 2012 0

Linux/UNIX Delete files with more than a week old

By in Bash, BSD, Linux

find /home/badlink/test/* -ctime +7 -delete

-ctime is creation time

+7 is more than 7 days

-delete is the action, you subtitute -delete for -print this way you are gona list the files with more than a week old


Tags: , ,

August 16, 2012 0

Solr Multicore install and config – Part 1

By in BSD, Linux

Install Multicore

First install tomcat6: aptitude install tomcat6

Get the last stable release of solr @ http://apache.ziply.com/lucene/solr/ . As of 16/Aug/2012 is 3.6.1 :

mkdir -p ~/tmp/solr
cd ~/tmp/solr/
wget http://apach.ziply.com/lucene/solr/3.6.1/apache-solr-3.6.1.tgz
tar xzvf apache-solr-3.6.0.tgz

Now choose where the files and cores of solr goes, i.e : /srv/solr

mkdir -p /srv/solr

Now copy the solr web application and example core files

cp apache-solr-3.6.1/dist/apache-solr-3.6.1.war /srv/solr/solr.war
cp -R apache-solr-3.6.1/example/multicore/* /srv/solr/
chown -R tomcat6 /srv/solr/

Point Catalina to the solr

echo -e '<Context docBase=”/var/solr/solr.war” debug=“0” privileged=“true” allowLinking=“true” crossContext=“true”>\n<Environment name=“solr/home” type=“java.lang.String” value=”/var/solr” override=“true” />\n</Context>' | tee -a /etc/tomcat6/Catalina/localhost/solr.xml
echo 'TOMCAT6_SECURITY=no' | tee -a /etc/default/tomcat6

Edit the init script (/etc/init.d/tomcat6) to set solr.home, pointing it at /srv/solr. Do this where the VARs are declared, the VAR is:

JAVA_OPTS=“$JAVA_OPTS -Dsolr.home=/srv/solr”

Restart tomcat

/etc/init.d/tomcat6 restart

Now you can access it via web on localhost:8080

ssh -L 8080:localhost:8080 user@host

Open your browser on localhost:8080/solr and there you go! :)

Tags: , , , ,

March 20, 2012 0

Exchange Server 2010 Archive – Check Mailbox Archive Size

By in Exchange Server, Microsoft


The following commands will show you, a single mailbox archive size, and the size on all the mailboxes with archive enabled!

Tags: , ,

March 6, 2012 0

Recover Mailbox – Microsoft Exchange Server 2010

By in Exchange Server, Microsoft, Windows Server

1- Restore the Mailbox Store (.edb file) from the backup and also the log files!

2- Go to the folder where you put the .edb file . We need now to check if the database was clean shutdown or dirty shutdown.

[PS] S:\Data>eseutil.exe /mh SG1.edb


This database is now in Clean Shutdown, but is was in Dirty Shutdown condition.

Next lets see if our log files are ok!

[PS] S:\Data>eseutil.exe /mh S:\Recovery\RDB1\E02

(Being E02 my prefix for the logs and my log are on S:\Recovery\RDB1\)


This is important since our log files must be ok! This is Full backup, plus the incremental!

3 – Now we try to recover the database with the log files.

In my case:

[PS] S:\Data>eseutil.exe /r E02 /l S:\Data\RDB1\ /a /d S:\Data\SG1.edb

If it was successfully check again the stat of the DB with eseutil.exe /mh

If still says dirty go to the folder where your edb file is (mine S:\Data) and run following command:

[PS] S:\Data>eseutil.exe /p SG1.edb

WARNING: This will take a long time and will lock the transaction log file! Be advised! My edb file with 335GB took about 13 hours to complete, but in the end it was in clean shutdown!!! :) URRA!

4- Now we have a database cleanly shutdown so we will mount it.

[PS] S:\Data>New-MailboxDatabase -Recovery -Name “RDB” -Server EXCH-MB1 -EdbFilePath S:\Data\SG1.edb -LogFolderPath S:\Data\E02

Open Exhange Management Console and check if the RDB is mounted and green! :)

5- Finally we will recover the mailbox we want. Create a normal Mailbox, name it whatever you want, i call it Recover, give to you full access on it! Add this to your outlook account!

And now we will restore the mailbox we want to a FOLDER inside the mailbox Recover we add previously created… You could restore to you own mailbox since it will create a folder and put all the folder of the mailbox to be recovered inside. But i prefer to separate things!

This command is tricky in the switches, the IDENTITY is the mailbox where you will put the recovered mailbox and RecoveryMailbox being the one to be restored!

[PS] S:\Data>Restore-Mailbox -Identity “Recover” -RecoveryMailbox “JohnDoe” -RecoveryDatabase RDB -TargetFolder “JohnDoeRecover” -Confirm

Wait until it finishes!

Now you can go check your Recover mailbox and there will be a folder name JohnDoeRecover with all the email and folders inside!

Hope this helps, any question put in the comments!



Tags: , ,

October 25, 2011 0

Copy Receive Connectors from one Exchange Server to another

By in Exchange Server, Microsoft

CASE: I added a new Exchange Server CAS and needed to create a special Receive Connectors that has alot of IP Addresses like printers and other services.

Doing this manually is a pain in the ass! But with only a command we can accomplish this!

CAS1 Being the server that I will copy the Receive Connector and CAS2 the new server where I will create the same connector as on the CAS1:

New-ReceiveConnector "Special Servers" -Server CAS2 -Bindings -RemoteIPRanges ( Get-ReceiveConnector "CAS1\Special Servers" ).RemoteIPRanges


September 13, 2011 0

Add User to Public Folder – Recursive Permissions

By in Exchange Server, Microsoft, Windows Server

This is normaly a pain in the ass!

But Microsoft has some cool scripts to add recursive permissions to the Public Folders. My example is from Exchange Server 2010 but it works on earlier versions too!

Navigate to your Exchange installation dir, for example (DO THIS IN POWERSHELL):

C:\Program Files\Microsoft\Exchange Server\V14\Scripts>

Now execute this command:

.\AddUsersToPFRecursive.ps1 -TopPublicFolder "\badLink Docs" -User "John" -Permission Owner

Tags: , , ,

February 23, 2011 0

AsbestOS v2.0 Released for PS3 !

By in Linux, PS3


My friend kha0S and PS3 hacker kmeaw released a new version of Linux loader slash installer (only in external disk for now… :D ) ! This is great for all the people that want the other OS option again!

I tried the asbest OS v1.2 and was great! Now I will try this that is a major improvement in every aspect!

So go check their site @ http://ps3.khore.org/asbestos-v20-released

Tags: , , ,

December 29, 2010 0

Setting Permissions recursively via Command Prompt

By in Microsoft

I had to kill an old File Server in Windows Server 2000 but needed to copy all the shares to the new NAS.

I use robocopy for the copying itself but i got to the problem about permissions on the user. I needed to keep all other permissions and add myself to them.


This allowed me to put myself with self control in every folder and file specifying only the root dir! :)

The program is much more than this, so check all the examples HERE.

My Commands:

robocopy.exe sourcedir destinationdir /R:0 /W:0 /MIR /COPYALL /LOG:c:\admin\robocopy.log

NOTE: The robocopy comes with Windows.

SetACL -on h:\Example(rootdir) -ot file -actn ace -ace n:domain\user;p:full

This worked like a charm! :) Very good program! Use it! :)

Tags: , , ,

December 10, 2010 3

Allow users to Change IP Address with Group Policy (GPO)

By in Microsoft, Windows Server

I saw many people asking around the web how to this by GPO. To allow users to change IP Address settings on the windows machine they logon with a GPO.

Well in this case you will need to user Restricted Groups on the GPO.

First create a Security Group that you will use to put the users that you want to allow to change the IP on their local machines.

I will use domain users just as an example (YOU SHALL NOT do this)!

I named the new GPO as Allow_Users_Change_IP_Address.

Now Right Click and choose Add Group…

Here you will choose the group you created for users that will be able to make the changes.

Now this new window appear and you will add the following group -> Network Configuration Operators

What will this do? This will add your created group, to the local group Network Configuration Operators in all the computers in the OU that has this policy linked!

Now just click ok and that is it! :)

Quite simple! :)

Any questions, ask in the comments!

Tags: , , ,