Some links on measuring these:
I was triggered by some messages in a thread:
Posted by jpluimers on 2023/05/02
Some links on measuring these:
I was triggered by some messages in a thread:
Posted in Development, ESP32, Hardware Development, Hardware Interfacing, IKEA hacks, LifeHacker, Power User | Leave a Comment »
Posted by jpluimers on 2023/04/27
I want to check out how to do POST requests using bookmarklets in order to save URLs to the Wayback machine.
The reason is that every few months or so, saving a page the normal way through a something like https://web.archive.org/save/URL fails for one reason or the other, but going to https://web.archive.org/save, then entering URL, and pressing “SAVE PAGE” button works fine:
job failed and 404 errors over the last few days? … and … just returned a 404; most of my archivals the last few days failed or had to be retried at least half a dozen times to succeed. …” / TwitterThe the failing way above is using a GET request, the succeeding workaround will open https://web.archive.org/save/URL using the below POST request (where I omitted some HTTP cookies and HTTP header fields for brevity).
PowerShell:$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession $session.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36" Invoke-WebRequest -UseBasicParsing -Uri "https://web.archive.org/save/URL" ` -Method "POST" ` -WebSession $session ` -Headers @{ "method"="POST" "origin"="https://web.archive.org" "referer"="https://web.archive.org/save" } ` -ContentType "application/x-www-form-urlencoded" ` -Body "url=URL&capture_outlinks=on&capture_all=on&capture_screenshot=on"
bash:curl 'https://web.archive.org/save/URL' \ -H 'origin: https://web.archive.org' \ -H 'content-type: application/x-www-form-urlencoded' \ -H 'referer: https://web.archive.org/save' \ --data-raw 'url=URL&capture_outlinks=on&capture_all=on&capture_screenshot=on' \ --compressed
fetch("https://web.archive.org/save/URL", { "headers": { "content-type": "application/x-www-form-urlencoded", }, "referrer": "https://web.archive.org/save", "body": "url=URL&capture_outlinks=on&capture_all=on&capture_screenshot=on", "method": "POST", "mode": "cors" });
BTW: Yes, I know that URL is not a valid URL, so it will return a page with “http://url/ URL syntax is not valid.“.
All links below via [Wayback/Archive] bookmarklet post request – Google Search:
I tried to put createFormSubmittingBookmarklets/createFormSubmitBookmarklets.js in a bookmarklet using both userjs.up.seesaa.net/js/bookmarklet.html and skalman.github.io/UglifyJS-online. That failed: somehow this code does not want to run as bookmarklet.
Running it from the console is fine though, and gave me this basic bookmarklet template:
javascript:function sf(ur,ty,fd){function me(tg,pr){var el=document.createElement(tg);for(const[nm,vl]of Object.entries(pr)){el.setAttribute(nm,vl);}return el}const fm=me("form",{action:ur,method:ty,style:"display:hidden;"});for(const[nm,vl]of Object.entries(fd)){fm.appendChild(me("input",{name:nm, value:vl}))}document.body.appendChild(fm);fm.submit()}sf("https://web.archive.org/save","post",{"url":"URL","capture_outlinks":"on","capture_all":"on","capture_screenshot":"on","wm-save-mywebarchive":"on","email_result":"on","":"SAVE PAGE"});
There bold URL there is the URL to be saved. I need to test this, then rework it to become parameterised.
–jeroen
Posted in Bookmarklet, Development, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers, Web Development | Leave a Comment »
Posted by jpluimers on 2023/04/26
Labeling cables is important, especially when you have a lot of them, and it is tough:
Hopefully heat-shrink tubing you can print on with either Dymo or Brother laber writers will outlast 3. At least they won’t loosen like 2. and 1.
So I was glad that [Archive] Jilles🏳️🌈 (@jilles_com) / Twitter started a thread, which I tried to help keeping coherent.
Some of the messages:
On a whim I ordered the DYMO LabelManager 160 label maker (well under $20) on the off chance that since the label reels are identical between the vinyl labels that it uses and this shrink wrap that maybe, just maybe it’ll work. Not to mention, save me at least $60.
As it turns out , IT DOES WORK !
[Archive] Jilles🏳️🌈 on Twitter: “Seems Nineleaf is selling DYMO compatible printable heat shrink tubes for way less: 1805443 24mm 18057 19mm = 3/4″ 18055 12mm = 1/2″ 18053 9mm = 3/8″ 18051 6mm = 1/4″ …”From left to right: 6mm(1/4″), 9mm(3/8″), 12mm(1/2″), 18mm(3/4″), 24mm(1″), each length 1.5m (5′).
From left to right: 6mm(1/4″), 9mm(3/8″), 12mm(1/2″), 18mm(3/4″), 24mm(1″), each length 1.5m (5′).
–jeroen
Posted in Development, Hardware Development, Hardware Interfacing | Leave a Comment »
Posted by jpluimers on 2023/04/25
Wow, just wow: [Archive] Kevin Lewis (he/him) on Twitter: “Wow thanks for all the support folks! I’ve been working on this project today: larger font, options for single/group captioning powered by @DeepgramAI, and a static badge mode as suggested by @bitandbang https://t.co/FBELwDsD4V” / Twitter
Via [Archive] Jilles🏳️🌈 on Twitter: “Love it and worried about it at the same time.” / Twitter
–jeroen
Posted in Development, Hardware Development, Hardware Interfacing, Software Development | Leave a Comment »
Posted by jpluimers on 2023/04/20
Boy I wish threads with more than one person could be saved by the ThreadReaderApp.
Anyway:
[WayBack] Thread by @mipsytipsy: oh boy.. i was just idly musing over how the single most ubiquitous/useless metric is “CPU load average”, lol i wonder if you could use CPU…
oh boy.. i was just idly musing over how the single most ubiquitous/useless metric is “CPU load average”, lol
i wonder if you could use CPU load alerts to score how modern and powerful a team’s toolchain is, like a Waffle House Index for tooling. 🤔
…oh oh! but i was gonna say, this thread between @drk and @shelbyspees is a killer nanotutorial in how to ask better questions about your code — where to start, how to drill down and dig in, how to instrument, and how to approach such an open-ended exploratory jaunt. 👏🐝❤️it’s a really good illustration of this thing we end up saying all the time, which is “don’t fear the future, it is simpler and clearer and *easier* here! the way you are doing it NOW is the hard way!” 😖
time for cpu load average to go the way of the PC LOAD LETTER …
0:00/ 0:01
Posted in *nix, Cloud, Development, DevOps, Infrastructure, Power User, Software Development, Systems Architecture | Leave a Comment »
Posted by jpluimers on 2023/04/19
Having my background before the web-development era, and having lived mostly in back-ends or client-server front-ends, I sometimes need to really dig into things in order to understand them better.
CORS is such a thing, so below are some links to get started. My main interest is CORS proxies as they will force me do go deep and really get what is going on below the surface.
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served.
Defunct CORS proxy sites:
Used searches:
–jeroen
Posted in Communications Development, Development, HTTP, Internet protocol suite, REST, Software Development, TCP, Web Development | Leave a Comment »
Posted by jpluimers on 2023/04/18
Cool one-liner program via [Archive] Jilles🏳️🌈 (@jilles_com) / Twitter:
for s in 0123456789ABCDEF 172.16.0.254 Passwd:admin;do echo -en "Big Endian: $s\nMiddle Endian: ";echo -n $s|xxd -e -g 4 | xxd -r;echo -en "\nLittle Endian: ";echo -n $s|xxd -e -g 2 | xxd -r;echo -en "\nReversed : ";echo -n $s|xxd -p -c1 | tac | xxd -p -r;echo -e "\n";done
Note that the hex are bytes, not nibbles, so the endianness is OK:
Big Endian: 0123456789ABCDEF Middle Endian: 32107654BA98FEDC Little Endian: 1032547698BADCFE Reversed : FEDCBA9876543210 Big Endian: 172.16.0.254 Middle Endian: .2710.61452. Little Endian: 71.2610.2.45 Reversed : 452.0.61.271 Big Endian: Passwd:admin Middle Endian: ssaPa:dwnimd Little Endian: aPssdwa:mdni Reversed : nimda:dwssaP
That nibble/byte thing confused me at first (as I associate hexadecimal output with hex dumps, where each hexadecimal character represents a nibble)) so here are some interesting messages from the thread that Jilles_com started:
for s in 0123456789ABCDEF 172.16.0.254 Passwd:admin;do echo -en "Big Endian: $s\nMiddle Endian: ";echo -n $s|xxd -e -g 4 | xxd -r;echo -en "\nLittle Endian: ";echo -n $s|xxd -e -g 2 | xxd -r;echo -en "\nReversed : ";echo -n $s|xxd -p -c1 | tac | xxd -p -r;echo -e "\n";done …” / TwitterSome related man pages:
tac(1): concatenate/print files in reverse – Linux man pagexxd(1): make hexdump/do reverse – Linux man pageecho(1): line of text – Linux man pagefor(1): perform set of commands multiple times – Linux man pageman(1): format/display on-line manual pages – Linux man page–jeroen
Posted in *nix, *nix-tools, bash, Development, Power User, Scripting, Software Development, xxd | Leave a Comment »
Posted by jpluimers on 2023/04/17
Learned a new thing a while ago: I knew about the ſʒ ligature (that nowadays usually is written as ß), but the tʒ ligature was new to me.
So: Güntʒelstraſʒe == Güntzelstraße.
References:
tʒ is a combination of these Unicode code points:
ſʒ is a combination of these Unicode code points:
Source: [Archive.is] Berlin Typography on Twitter: “The best of #TypeInBerlin: The tʒ and ſʒ ligatures, together at last. …” / Twitter
Posted in Development, Encoding, LifeHacker, Power User, Software Development, Unicode | Leave a Comment »
Posted by jpluimers on 2023/04/13
MikroTik switches and routers are very flexible to configure, as everything is done through [Wayback/Archive] RouterOS settings.
This means that given enough ports, you can split a physical switch into logical switches. This can be very convenient when you run multiple networks without VLAN.
Earlier this week, I already wrote about Torching a specific port on a MikroTik switch or router running RouterOS which involved turning off hardware acceleration off for specific ports in order to have the flow through the underlying switch chip prohibiting torch and filter features.
For splitting noticing which ports are connected to which switch chip is also important: splitting works best if you can configure each logical switch to exclusively use network ports on one switch chip.
This post was to both research how to configure this, and if my MikroTik devices would allow for hardware acelleration.
Here are some links that should help me with configuring (via [Wayback/Archive] mikrotik split switch in two – Google Search):
–jeroen
Posted in Development, Hardware, MikroTik, Network-and-equipment, Power User, RouterOS, routers, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2023/04/11
On most recent [Wayback/Archive] RouterOS configurations of MikroTik Routers and Switches, running [Wayback/Archive] Torch a port will show zero traffic when they are part of a bridge configuration. The same holds for the Packet Sniffer.
The reason is that these bridges have hardware acceleration turned on, which makes all traffic go through the switch chip instead of the device CPU. Torch works on the CPU level, so won’t show hardly any traffic except for some configuration stuff (depending on the combination of switch chip and CPU type).
This is not documented in the Torch documentation, but it is documented in the Packet Sniffer documentation.
Further reading:
Note: Unicast traffic between Wireless clients with client-to-client forwarding enabled will not be visible to sniffer tool. Packets that are processed with hardware offloading enabled bridge will also not be visible (unknown unicast, broadcast and some multicast traffic will be visible to sniffer tool).
As the ethernet ports are marked as S(laves) in the tables, I would assume that they are member ports of bridges and “hardware acceleration” is enabled (the value of hw in the respective rows of /interface bridge port is set to yes). So any frames which pass through these ports to other ports of the same switch chip are counted by the switch chip counters, but as they never get to the CPU, the torch cannot see them.
Consider the following scenario, you setup a bridge and have enabled hardware offloading in order to maximize the throughput for your device, as a result your device is working as a switch, but you want to use Sniffer or Torch tools for debugging purposes, or maybe you want to implement packet logging.
/interface bridge add name=bridge1 /interface bridge port add bridge=bridge1 hw=yes interface=ether1 learn=yes add bridge=bridge1 hw=yes interface=ether2 learn=yes
When running Sniffer or Torch tool to capture packets you might notice that barely any packets are visible, only some unicast packets, but mostly broadcast/multicast packets are captured, while the interfaces report that much larger traffic is flowing through certain interfaces than the traffic that was captured. Since RouterOS v6.41 if you add two or more Ethernet interfaces to a bridge and enable Hardware Offloading, then the switch chip will be used to forward packets between ports. To understand why only some packets are captured, we must first examine how the switch chip is interconnected with the CPU, in this example we can use a block diagram from a generic 5-Port Ethernet router:Generic Ethernet router
For this device each Ethernet port is connected to the switch chip and the switch chip is connected to the CPU using the CPU port (sometimes called the switch-cpu port). For packets to be visible in Sniffer tools, the packet must be sent from an Ethernet port to the CPU port, this means that the packet must be destined to the CPU port (destination MAC address of the packet matches the bridge’s MAC address) or the packet’s MAC address has not be learnt (packet is flooded to all ports), this behavior is because of MAC learning·The switch chip keeps a list of MAC addresses and ports called the Hosts table· Whenever a packet needs to be forwarded, the switch chip checks the packet’s destination MAC address against the hosts table to find which port should it use to forward the packet. If the switch chip cannot find the destination MAC address, then the packet is flooded to all ports (including the CPU port). In situations where packet is supposed to be forwarded from, for example, ether1 to ether2 and the MAC address for the device behind ether2 is in the hosts table, then the packet is never sent to the CPU and therefore will not be visible to Sniffer or Torch tool..
Packets with a destination MAC address that has been learned will not be sent to the CPU since the packets are not not being flooded to all ports. If you do need to send certain packets to the CPU for packet analyser or for Firewall, then it is possible to copy or redirect the packet to the CPU by using ACL rules. Below is an example how to send a copy of packets that are meant for
4C:5E:0C:4D:12:4B:/interface ethernet switch ruleadd copy-to-cpu=yes dst-mac-address=4C:5E:0C:4D:12:4B/FF:FF:FF:FF:FF:FF ports=ether1 switch=switch1Note: If the packet is sent to the CPU, then the packet must be processed by the CPU, this increases the CPU load.
The following script is used to associate IP address of directly connected stations to physical port of the switch.
Warning: Running this script will make the CPU go to 100% for about 30-40 seconds, so please run the script when needed or by using scheduler.
–jeroen
Posted in Development, Hardware, MikroTik, Power User, RouterOS, routers, Scripting, Software Development | 1 Comment »