Skip to content

Instantly share code, notes, and snippets.

00:00:00.014446 VirtualBox VM 7.0.12 r159484 linux.amd64 (Oct 12 2023 19:34:18) release log
00:00:00.014448 Log opened 2024-01-05T09:03:38.349406000Z
00:00:00.014448 Build Type: release
00:00:00.014451 OS Product: Linux
00:00:00.014451 OS Release: 6.2.0-39-generic
00:00:00.014452 OS Version: #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2
00:00:00.014469 DMI Product Name: 20XXS4XK00
00:00:00.014474 DMI Product Version: ThinkPad X1 Carbon Gen 9
00:00:00.014478 Firmware type: UEFI
00:00:00.014998 Secure Boot: Disabled
INFO global: Vagrant version: 2.4.0
INFO global: Ruby version: 3.1.4
INFO global: RubyGems version: 3.3.26
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_APPIMAGE_LD_LIBRARY_PATH="/tmp/.mount_vagranOPDlYc/usr/lib/:/tmp/.mount_vagranOPDlYc/usr/lib/i386-linux-gnu/:/tmp/.mount_vagranOPDlYc/usr/lib/x86_64-linux-gnu/:/tmp/.mount_vagranOPDlYc/usr/lib32/:/tmp/.mount_vagranOPDlYc/usr/lib64/:/tmp/.mount_vagranOPDlYc/lib/:/tmp/.mount_vagranOPDlYc/lib/i386-linux-gnu/:/tmp/.mount_vagranOPDlYc/lib/x86_64-linux-gnu/:/tmp/.mount_vagranOPDlYc/lib32/:/tmp/.mount_vagranOPDlYc/lib64/::/lib:/lib64:/usr/lib:/usr/lib64"
INFO global: VAGRANT_RUBYLIB=""
INFO global: VAGRANT_USR_DIR="/tmp/.mount_vagranOPDlYc/usr"
INFO global: VAGRANT_APPIMAGE_HOST_LD_LIBRARY_PATH="/lib:/lib64:/usr/lib:/usr/lib64:/tmp/.mount_vagranOPDlYc/usr/lib/:/tmp/.mount_vagranOPDlYc/usr/lib/i386-linux-gnu/:/tmp/.mount_vagranOPDlYc/usr/lib/x86_64-linux-gnu/:/tmp/.mount_vagranOPDlYc/usr/lib32/:/tmp/.mount_vagranOPDlYc/usr/lib64/:/tmp/.mount_vag
@andresbott
andresbott / About: bake vagrant image with guest additions
Last active November 1, 2022 12:49
Vagrant debian vbguest workaround
This is a quick workaround for https://github.com/dotless-de/vagrant-vbguest/issues/399
instead of relying on the vagrant plugin, this solution bakes a new vagrant image with the guest additions installed,
this new image can then be used as base in your vagrant.
the main drawback is that you need to bake the image separetely every time you setup the project or make a change to the base
@andresbott
andresbott / gist:46d431ed5e4a977f5a30c5c380f644b5
Created March 31, 2018 21:22
Node Red Stock market warning, send a email when a stock value goes bellow a configured value
[{"id":"b459b352.e35c5","type":"inject","z":"fdb65e1e.45f03","name":"","topic":"","payload":"","payloadType":"date","repeat":"7200","crontab":"","once":false,"onceDelay":"","x":175,"y":76,"wires":[["b38a40f7.6890f"]]},{"id":"31944a31.4db1e6","type":"http request","z":"fdb65e1e.45f03","name":"Get current price from iextrading.com","method":"GET","ret":"txt","url":"https://ws-api.iextrading.com/1.0/stock/{{{stock_item}}}/price","tls":"","x":480.18182373046875,"y":118,"wires":[["fc60b702.6ddaf8"]]},{"id":"b296ce5e.4edd8","type":"debug","z":"fdb65e1e.45f03","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":997,"y":78,"wires":[]},{"id":"fc60b702.6ddaf8","type":"function","z":"fdb65e1e.45f03","name":"Compare Stock Value","func":"// This function compares the payload with warn_level\nmsg.warn_level = msg.warn_level || 0.0;\n\nvar mailTopic = \"[WARN] \"+msg.stock_item+\" Stock value\";\nvar mailFrom = \"mail@mail.com\";\n\nfunction addZero(i) {\n if (i < 10) {\n
@andresbott
andresbott / html.esp
Created November 26, 2017 01:12
apache sling ESP sample
<% sling.include("/apps/fileshare/content/header"); %>
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">This will show a fileLink</h1>
<div class="account-wall">
</div>
</div>
@andresbott
andresbott / gist:d206246432b0f2299ea26db2846bfa4d
Created June 7, 2016 20:01
linux freeDesktop services autostart
/etc/xdg/autostart and ~/.config/autostart are specified by the freedesktop.org project to start applications at login time. The freedesktop.org specifications are honored by nearly every desktop environment on linux. if you want to provide a mechanism to autostart an app or to specify a menu entry or a mime-type that is not specific to one desktop environment only, than you can rely always on the freedesktop.org stuff.
edit the file NotShowIn=GNOME;KDE;Unity;
@andresbott
andresbott / gist:d82154063e37944a75d11c511150da0d
Created April 11, 2016 20:27
form checkbox send value if unchecked
<input type="hidden" name="remindME" value="0">
<input name="remindME" type="checkbox"> Recuerdame</label>
@andresbott
andresbott / gist:11a36f64031bfeb975ec
Created February 10, 2016 14:13
Wondershaper speed limit + 10Mbps
when using wondershaper to limit high speed connections it does not work.
https://github.com/magnific0/wondershaper/issues/2 solves this
buzzy commented on 26 Oct 2013
I changed the line:
tc qdisc add dev $IFACE root handle 1: cbq avpkt 1000 bandwidth 10mbit
Into:
tc qdisc add dev $IFACE root handle 1: cbq avpkt 1000 bandwidth 1000mbit
And now everything works correctly. Now sure why the script is hardcoded to 10mbit though...
@andresbott
andresbott / gist:b5586fadc36ba46fdac1
Created January 19, 2016 01:49
Solve mppe_compress[0]: osize too small! (have: 1408 need: 1412)
taken from: http://danielsokolowski.blogspot.com.es/2013_04_01_archive.html
This due to the way MPPE Microsoft point-to-point Encryption encodes data which results in the packet size being bigger then what was agreed in the VPN handshake - is my guess. There is a reported bug from 2005 which sadly hast not yet been addressed.
Fixing the issue by increasing the MTU
You can't fix this issue by modifying the MTU/MRU settings in '/etc/ppp/options' directly, you have to adjust the MTU after the PPP connection is up and this can be accomplished by adding a custom 'ip-up' script.
Below is my workaround script, place it into file '/etc/ppp/ip-up.d/mppefixmtu' and ensure that it is executable ('chmod +x mppefixmtu'):
#!/bin/sh
CURRENT_MTU="`ifconfig $1 | grep -Po '(?<=MTU:)([0-9]+)'`"
@andresbott
andresbott / gist:6e48d4f2bfb70767319d
Created November 3, 2015 17:37
64bit GNU/Linux and Webcams (Logitech Quickcam Express)
Copied from here: https://www.martineve.com/2011/09/25/64bit-gnulinux-and-webcams-logitech-quickcam-express/
```
I've just been playing around with my webcam, which I haven't hooked up in ages, and was unable to get it working under my 64bit Fedora installation. Having done a bit of reading, and having found that some applications can use the camera, I worked out the solution.
32bit applications need to have the 32bit library put into their LD_PRELOAD environment variable.
This will work only if your camera is being correctly detected, but doesn't seem to work in certain apps. To check, run dmesg and look for the following output:
[ 2.878055] usb 2-4: New USB device found, idVendor=046d, idProduct=0928
[ 2.878261] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0