Skip to main content

Posts

Caddy web server configuration for rewrite with multiple variables parameters

  http://localwebsite {         # Set this path to your site's directory.         #root * /usr/share/caddy         root * /var/www/website           #makes /course/id/name.html to /course.php?id=id&name=name         @zxp {                 #path_regexp myregex ^/course/(\d+)/([%A-Za-z0-9_-]+)\.html$                 path_regexp myregex ^/course/([^/]+)/([^/]+)\.html$         }         rewrite @zxp /course.php?id={re.myregex.1}&name={re.myregex.2}           # rewrite /course/([^/]+)/([^/]+)\.html /course.php?id={1}&name={2}         # rewrite /course/(\d+)/([A-Za-z0-9_-]+)\.html /course.php?id=$1&name=$2         # rewrite /course/(\w+)/(\w+)\.html /course.php?id={1}&name={2}         #rewrite /course {         #       r ^/(\w+)/(\w+)\.html$         #       to /course.php?id={1}&name={2}         #}         # Enable the static file server.         file_server         # Another common task is to set up a reverse proxy:         # reverse_proxy localhost:8080        
Recent posts

Bypassing the error by "go get" "tls: failed to verify certificate: x509: certificate signed by unknown authority"

When I was trying to download dependencies for my go project in an old Ubuntu machine I was getting this error all the time: "go: gopkg.in/alexcesaro/quotedprintable.v3@v3.0.0-20150716171945-2caba252f4dc: Get "https://proxy.golang.org/gopkg.in/alexcesaro/quotedprintable.v3/@v/v3.0.0-20150716171945-2caba252f4dc.mod": tls: failed to verify certificate: x509: certificate signed by unknown authority" Which the main part of it was go get failing to authenticate: " tls: failed to verify certificate: x509: certificate signed by unknown authority " I tried many things but couldn't make it work until I found the way: export GOINSECURE="proxy.golang.go" This will tell go get to ignore certification validity. Then export GOPROXY=direct This will tell go get to by pass proxy Then git config --global http.sslverify false And only after those I could run again: go get And it worked

They all need to go after 7th of October

 

List of software and apps that does not require registration and just works

List of software and apps that does not require registration and just works out of the box without too many ads and without need to registrations. The list of applications for Android and Linux desktop that just do the work they need to do. Nothing more. Nothing less. K-9 Email Mail for Android Otomusic - music mp3 player application for Android    

Writing a json to smtp email proxy in go (golang) json2smtp

I wrote a json2smtp proxy server that can be self hosted in Go (golang) See here: https://www.c2kb.com/json2smtp https://github.com/caviv/json2smtp   The reason why I needed to write an email proxy was because I was called to do some maintenance on an old legacy system. This system was running on Windows Server 2012, with php version 5.5.6 and Apache 2.4. Very old versions of software. The system was sending emails using the php smtp package and old libssl.dll which supports only TLSv1.0. The smtp service they were using (AWS SES Simple Email Service) has recently dropped the support for SMTP connection via TLS version 1.0. Now in order to support TLS v1.2 for emails on smtp I have to upgrade the whole system. Windows version, php version, Apache version and more - this would have taken me a very long time with many obstacles on the way. Amazon support:  https://docs.aws. amazon.com/ses/latest/dg/ security-protocols.html The solution I have chosen was to write this proxy, so calls fro

Taking a screenshot and creating thumbnail of webpage html as an image via command line

There are a few options to take screenshot of a webpage or save a webpage as an image on the disk via the command line. This can allow you to create a thumbnail of a web site easily by one command on the terminal.   Using chrome to save a webpage as an image: chrome --screenshot=google.png --headless --window-size=1024,768 https://www.google.com/    Using cutycapt to screenshot a webpage: https://cutycapt.sourceforge.net/   Using webkit2png to create site thumbnail: https://paulhammond.org/webkit2png   You can also use Midori browser