Thursday, May 25, 2017

[TERMINAL] - Force unmount drive on OSX


open terminal and write command:

diskutil unmount force /Volumes/NAME-OF-DRIVE

Wednesday, May 24, 2017

[TERMINAL] - Move file to folder based by name file.

This command iterate over all PDF files, create a folder with same name of file and move the file to inside.

for i in *.pdf; do folderName=`echo "$i"|cut -d- -f1`; mkdir -p "$folderName"; mv "$i" "$folderName"; done

You can use for PDF or other extension file, just change *.pdf to *.doc, or *.jpg, ...

Monday, May 22, 2017

SOAPUI 5.x.x crashes on OSX


SOAPUI crashes after start (version > 5)


  1. Force Kill all soapUI Processes. Start ‘Activity Monitor’ select soapUI process and kill all. 
  2. Open Finder and navigate to application folder, /Applications/SoapUI-5.x.x.app, right button and select option "Show Package Contents". 
  3. Navigate to /Contents/java/app/bin/ and edit file soapui.sh 
  4. Find and uncomment this line # JAVA_OPTS="$JAVA_OPTS -Dsoapui.browser.disabled=true and save file.
  5. Navigate to /Contents and edit file vmoptions.txt 
  6. Add at end of document insert line -Dsoapui.browser.disabled=true 
  7. Close all documents and start again your SoapUI.


This steps worked for me OS X 10.11.6.
Hope this helps

Replace soapUI-5.x.x.app with your application version, my version is soapUI-5.3.0.app

Friday, May 19, 2017

[HTTPS] - Force Chrome accept self-signed localhost certificate

Open Chrome and paste this code on address bar:
chrome://flags/#allow-insecure-localhost
You should see highlighted text saying: "Allow invalid certificates for resources loaded from localhost"
Click Enable.
IMPORTANT: do this is only for LOCALHOST

Thursday, May 18, 2017

[SVN] - Commands from coomand lin

List of useful commands to use SVN from command line.
svn info
Display information about a local or remote item.

svn list
Display list of directories in the repository.

svn up
Update your code from repository.

svn co http://your-svn-repo/your-project-name/[trunk]
Checkout project from server

svn propget svn:externals . > ext.txt
Get externals from folder to file [ext.txt]

svn propset svn:externals -F ext.txt .
Set ignore list of files to commit [need create file with name .svnignore on base folder]

svn propset svn:ignore -F .svnignore .
Set global (recursive) ignore list of files to commit [need create file with name .svnignore on base folder]

svn propset svn:global-ignore -F .svnignore .
Commit only externals from folder
svn commit --depth empty . -m 'Modify externals definition'
Delete property

svn propdel [svn:externals | svn:ignore | ...]
Set externals from file [ext.txt] to folder
svn commit [path-of-files-to-commit] -m 'YOUR COMMENT'
Submit your changes to repository


svn sw http://your-svn-repo/your-project-name/[branch / tag]
Switch your code to another path


svn log --limit 10 | svn log -l 10
Get the last 10 commits 

Local SSL websites on mac OSX


These instructions will guide you through the process of setting up local, trusted websites on your own computer.

Configuring SSL

Within Terminal, create an SSL directory.
sudo mkdir /etc/apache2/ssl
Next, generate a private key and certificate for your site.
sudo openssl genrsa -out /etc/apache2/ssl/localhost.key 2048
sudo openssl req -new -x509 -key /etc/apache2/ssl/localhost.key -out /etc/apache2/ssl/localhost.crt -days 3650 -subj /CN=localhost
Finally, add the certificate to Keychain Access.
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /etc/apache2/ssl/localhost.crt

Configuring SSL: Setting up a Trusted Virtual Host

Within Terminal, edit the Apache Configuration.
edit /etc/apache2/httpd.conf
Within the editor, uncomment lines 89 and 143 to enable modules required by HTTPS.
LoadModule socache_shmcb_module libexec/apache2/mod_socache_shmcb.so
LoadModule ssl_module libexec/apache2/mod_ssl.so
Next, uncomment line 516 to enable Trusted Virtual Hosts.
Include /private/etc/apache2/extra/httpd-ssl.conf
Back in Terminal, edit the Virtual Hosts configuration.
edit /etc/apache2/extra/httpd-vhosts.conf
Within the editor, add a 443 VirtualHost Name and localhost Directive at the end of the file, replacing indieweb with your user name.
<VirtualHost *:443>
    ServerName localhost
    DocumentRoot "/Users/indieweb/Sites/localhost"

    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /etc/apache2/ssl/localhost.crt
    SSLCertificateKeyFile /etc/apache2/ssl/localhost.key

    <Directory "/Users/indieweb/Sites/localhost">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>
Back in Terminal, edit the SSL configuration.
edit /private/etc/apache2/extra/httpd-ssl.conf
Next, comment lines above to skip the default Server Certificate and Server Private Key.
#SSLCertificateFile "/private/etc/apache2/server.crt"
#SSLCertificateKeyFile "/private/etc/apache2/server.key"
Next, beneath the commented certificates or keys, add references to your certificate and key.
SSLCertificateFile "/etc/apache2/ssl/localhost.crt"
SSLCertificateKeyFile "/etc/apache2/ssl/localhost.key"
Back in Terminal, restart Apache.
sudo apachectl restart
Now, in a web browser, visit https://localhost. The domain should appear trusted, and you should see a message stating that localhost works!.