Category Archives: Uncategorized

HTTPS Redirect with exclude

Example how to redirect to HTTPS, but excluding .well-know/* directory. <VirtualHost *:80> ServerAlias domain.net RedirectMatch 301 ^/((?!\.well-known).*)$ https://domain.net/$1 </VirtualHost>

Posted in Uncategorized | Leave a comment

Angular starter project

https://github.com/marioosh-net/angular-starter

Posted in Uncategorized | Leave a comment

maven: Deploying .jar to remote Maven repository by ftp

<build> <plugins> <!– other plugins, skipped –> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> </plugin> </plugins>   <extensions> <!– Enabling the use of FTP –> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ftp</artifactId> <version>1.0-beta-6</version> </extension> </extensions> </build>   <distributionManagement> <repository> <id>repo-server</id> <url>ftp://192.168.1.253/var/maven</url> </repository> </distributionManagement> ~/.m2/settings.xml – need login/pass <settings> <servers> <server> <id>repo-server</id> <username>maven</username> <password>***</password> </server> </servers> </settings> On server (need active ftp daemon [...]

Posted in Uncategorized | Leave a comment

sendmail: send file contents

sendmail someone@somewhere.com < somefile

Also posted in Linux, Linux shell | Leave a comment

Eclipse SWT: javadocs link

http://help.eclipse.org/luna/topic/org.eclipse.platform.doc.isv/reference/api/index.html

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”}’ https://somewhere.com/rest/test

Posted in Uncategorized | Leave a comment

ThinkPad Bluetooth ON/OFF

ON echo 1 > /sys/devices/platform/thinkpad_acpi/bluetooth_enable OFF echo 0 > /sys/devices/platform/thinkpad_acpi/bluetooth_enable

Posted in Uncategorized | Leave a comment

crontab examples

# .—————- minute (0 – 59) # | .————- hour (0 – 23) # | | .———- day of month (1 – 31) # | | | .——- month (1 – 12) OR jan,feb,mar,apr … # | | | | .—- day of week (0 – 6) (Sunday=0 or 7) # | | | | [...]

Posted in Uncategorized | Leave a comment

node.js – Socket.IO

Dependencies npm install socket.io Server var fs = require(’fs’); var app = require(’http’).createServer( function(req, res) { // serwuj client.html fs.readFile(’client.html’, function(err, data) { res.writeHead(200); res.end(data); }); } ); app.listen(8081); var io = require(’socket.io’).listen(app);   io.sockets.on(’connection’, function (socket) { // send welcome message socket.emit(’from-server’, { date: ‘welcome to time service’ });   // send time on [...]

Also posted in node.js | Leave a comment

Spring MVC Quickstart using Maven

mvn archetype:generate -DgroupId=[YOUR_GROUP_ID] -DartifactId=[YOUR_ARTIFACT_ID] -DarchetypeGroupId=co.ntier -DarchetypeArtifactId=spring-mvc-archetype -DinteractiveMode=false

Posted in Uncategorized | Leave a comment