Posts

Showing posts with the label configuration

My Zed editor config setting json file

I am using Zed editor, mostly for Go and web development. It is fast, yet not mature enough though I am still using it. Here is my settings.json file for configuration: // Zed settings // // For information on how to configure Zed, see the Zed // documentation: https://zed.dev/docs/configuring-zed // // To see all of Zed's default settings without changing your // custom settings, run `zed: open default settings` from the // command palette (cmd-shift-p / ctrl-shift-p) {   "ui_font_size": 16,   "buffer_font_size": 16,   "theme": {     "mode": "system",     "light": "One Black",     "dark": "One Dark"   },   "tab_size": 4,   "languages": {     "HTML": {       "prettier": {         "allowed": false       }     }   } }  

Configure VSCode to debug Go (Golang) code

 Trying to make sure you can debug your code through Visual Studio Code (VSCode) is sometimes a bit tricky. Here is my json structure for the dvl running configuration of the launch.json file   { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Launch Package", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/main.go", "args": [ "--ini", "sample.ini", "--d", ] } ] } go, golang, debug, debugger, json, launch.json, configuratio...

Caddy webserver to prevent access from external machines on the network

How to protect your local caddy installation by preventing other machines outside of your localhost and local computer from accessing your device. Create rule: (block_outcoming) {        @denied not client_ip 127.0.0.1 ::1         handle @denied {                 respond "No access"         } }   Then inside your website configuration just add import  block_outcoming   E.g.: :80 {     import block_outcoming     root * /web/html }

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}     ...