This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run under Chrome console | |
console.log("Name,CPU Mark,Thread Mark,TDP"); | |
$$('tr.tablesorter-hasChildRow', $$('tbody')[1]).forEach(e => { | |
if (e.childNodes[6].innerText != "NA") | |
console.log('"' + e.firstChild.childNodes[1].innerText.trim() + '",', | |
+ parseInt(e.childNodes[2].innerText.replace(/,/g, '')) + ',', | |
+ parseInt(e.childNodes[4].innerText.replace(/,/g, '')) + ',', | |
+ parseInt(e.childNodes[6].innerText) + ',') | |
} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.body.innerHTML = document.body.innerHTML.replace(/[^\x20-\x7E]/g, ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Based on https://figwheel.org/docs/your_own_server.html. Just add reload middleware and wrap (run-jetty) in a (future) | |
;; And run it: | |
;; clojure -i @web/core.clj -m figwheel.main -b dev -r | |
(ns web.core | |
(:require [ring.adapter.jetty :refer [run-jetty]] | |
[ring.middleware.defaults :refer [wrap-defaults site-defaults]] | |
[ring.middleware.reload :refer [wrap-reload]] | |
[ring.util.response :refer [resource-response content-type]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=$$("div") | |
for(i=0; i<a.length-5; i++) { | |
if (a[i].textContent.match(/10\./) && a[i+5].textContent.match(/FW|SDY/)) { | |
var b=a[i+5].textContent.trim(); | |
var c=a[i].textContent.trim().replace(/\/.*/, ""); | |
console.log(`update devices set hostname="${b}" where ip="${c}";`); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns y2020.core | |
(:require [clojure.edn :as edn] | |
[clojure.string :as str])) | |
;; 202001 | |
(let [input (->> (slurp "src/y2020/input202001") (re-seq #"\d+") (map edn/read-string) sort) | |
f (fn [sum xs] | |
(loop [[x & morex :as x'] xs | |
[y & morey :as y'] (reverse xs)] | |
(when (and x morex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONFIG_ARCH="mips" | |
CONFIG_AUDIO_SUPPORT=y | |
CONFIG_AUTOREBUILD=y | |
CONFIG_BIG_ENDIAN=y | |
CONFIG_BINARY_FOLDER="" | |
CONFIG_BINUTILS_VERSION="2.29.1" | |
CONFIG_BINUTILS_VERSION_2_29_1=y | |
CONFIG_BUILD_SUFFIX="" | |
CONFIG_BUSYBOX_DEFAULT_ASH_ALIAS=y | |
CONFIG_BUSYBOX_DEFAULT_ASH_BASH_COMPAT=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$usageQueue = @() | |
while ($true) { | |
$currentDateTime = Get-Date -Format "yyyy-MM-dd HH:mm:ss" | |
$cpuUsage = Get-Counter '\Processor(_Total)\% Processor Time' | |
$cpuUsageValue = $cpuUsage.CounterSamples.CookedValue | |
$usageQueue += $cpuUsageValue | |
if ($usageQueue.Count -eq 13) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[09/23/2023] | |
Refs: | |
1. http://mirror.cs.pitt.edu/archlinux/iso/2023.09.01/archlinux-bootstrap-2023.09.01-x86_64.tar.gz | |
2. https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-virt-3.18.0-x86_64.iso | |
3. https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely | |
4. https://www.debian.org/releases/bookworm/amd64/apds03.en.html | |
See also: | |
1. Convert to Debian https://gist.github.com/zengxinhui/ee0ad6b7c7f99e2ead6cd0d2bd6641fd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib, os, sqlite3, sys | |
con = sqlite3.connect("hash.db") | |
cur = con.cursor() | |
cur.execute("delete from files") | |
for root, dirs, files in os.walk(sys.argv[1]): | |
for file in files: | |
filename = root + "/" + file | |
with open(filename, 'br') as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bb | |
;; babashka/clojure | |
(import 'java.security.MessageDigest) | |
(def SCAN_DIRS ["."]) | |
(def MIN_FILE_SIZE (* 1)) | |
(def SHA256_CHUNK_SIZE (* 1024 8)) |
OlderNewer