Skip to content

Instantly share code, notes, and snippets.

View dcrystalj's full-sized avatar

Tomaz dcrystalj

View GitHub Profile
@JimiSweden
JimiSweden / dwraw.io. configuration example.md
Last active January 22, 2024 02:15
draw.io windows app override default configuration to allow larger images

problem

When trying to insert an image you might get the warning "Image too big" when selecting "Actual size" in the insert dialog

Soulution

is to change the default settings.

note: this is tested on Windows, probably similar in Mac - check out the linke here if you are using Mac https://gist.github.com/cellularmitosis/e5e7d1517939b98418a58cdd8595dd8c

open Draw.io app ()

  • in menu "Extras" , select "Configuration".
@chabala
chabala / using-google-takeout.md
Last active May 3, 2024 20:05
Merge and extract tgz files from Google Takeout

Recently found some clowny gist was the top result for 'google takeout multiple tgz', where it was using two bash scripts to extract all the tgz files and then merge them together. Don't do that. Use brace expansion, cat the TGZs, and extract:

$ cat takeout-20201023T123551Z-{001..011}.tgz | tar xzivf -

You don't even need to use brace expansion. Globbing will order the files numerically:

$ cat takeout-20201023T123551Z-*.tgz | tar xzivf -
@meditto
meditto / server.ts
Created March 2, 2020 19:19
use SSL on Adonis 5 dev server
/*
|--------------------------------------------------------------------------
| AdonisJs Server
|--------------------------------------------------------------------------
|
| The contents in this file is meant to bootstrap the AdonisJs application
| and start the HTTP server to accept incoming connections. You must avoid
| making this file dirty and instead make use of `lifecycle hooks` provided
| by AdonisJs service providers for custom code.
|
@virolea
virolea / upload.js
Last active March 15, 2024 13:45
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
@cowboy
cowboy / mock-axios.js
Last active April 14, 2024 05:40
axios mocking via interceptors
import axios from 'axios'
let mockingEnabled = false
const mocks = {}
export function addMock(url, data) {
mocks[url] = data
}
@nikhita
nikhita / update-golang.md
Last active April 27, 2024 13:09
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active April 19, 2024 16:03
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@ygotthilf
ygotthilf / jwtRS256.sh
Last active April 30, 2024 18:17
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@manpages
manpages / bootable-win-from-linux.txt
Created December 12, 2014 14:57
How to make bootable Windows USB from Linux
Install ms-sys
You will need ms-sys to write a Master Boot Record (MBR) to the USB drive.
Make sure you have installed the gcc, make, and gettext repository packages in order to compile the source code.
Download the latest source code from http://ms-sys.sourceforge.net/#Download.
Un-tar the source code and change into the source code directory:
tar xvzf ms-sys-2.3.0.tar.gz