Angular starter project

Posted in Uncategorized | Leave a comment

maven: Deploying .jar to remote Maven repository by ftp

                        <!-- other plugins, skipped -->
			<!-- Enabling the use of FTP -->

~/.m2/settings.xml – need login/pass


On server (need active ftp daemon working with local user login/passwords):
$ useradd -m maven
$ passwd maven
$ mkdir /var/maven
$ chown -R maven:maven /var/maven

Posted in Uncategorized | Leave a comment

sendmail: send file contents

sendmail < somefile

Posted in Linux, Linux shell, Uncategorized | Leave a comment

Git tags

git tag -a v1.0 -m 'version 1.0' # add tag
git tag -d v1.0 # remove tag
git push origin :refs/tags/v1.0 # remove remote tag

Posted in git | Leave a comment

Eclipse SWT: javadocs link

Posted in Uncategorized | Leave a comment

curl: basic auth + json + post

curl --user user:pass -k -v -H "Content-Type: application/json; charset=utf-8" -X POST -d '{"text":"message"}'

Posted in Uncategorized | Leave a comment

Android – Save / Load state Fragment

public class SomeFragment extends Fragment {
    public final static String OBJECT_ATTR = "object";
    Data data;
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
         * restore
        if(savedInstanceState != null) {
            data = savedInstanceState.getParcelable(OBJECT_ATTR);
         * using data
     * called when configuration change, but not on getting fragment from back-stack
    public void onSaveInstanceState(Bundle outState) {
         * save
        outState.putParcelable(OBJECT_ATTR, data);
Posted in Android, Java | Leave a comment

Android: Install .apk from command line

adb install -r app.apk
Posted in Android | Leave a comment

Maven project from archetype – Interactive mode

mvn archetype:generate -Dfilter=org.apache.maven.archetypes:

Good ones for starting: maven-archetype-quickstart, maven-archetype-webapp

mvn archetype:generate -DarchetypeCatalog= -Dfilter=org.codehaus.mojo.archetypes:

Good ones for starting: ejb-javaee6, ejb-javaee7

Posted in Java, Maven | Leave a comment

openssl: self-signed certificate + .pfx

without CA

openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
openssl pkcs12 -passout pass:password -export -out server.pfx -inkey server.key -in server.crt

with CA

openssl req -new -x509 -extensions v3_ca -keyout ca.key -out ca.crt -days 3650
openssl genrsa -out certificate.key 1024
openssl req -new -key certificate.key -out certificate.csr
openssl x509 -req -days 365 -in certificate.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out certificate.crt
openssl pkcs12 -passout pass:password -export -out certificate.p12 -inkey certificate.key -in certificate.crt -chain -CAfile ca.crt
Posted in SSL | Tagged , , , | Leave a comment