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
zk_version 3.7.0-e3704b390a6697bfdf4b0bef79e3da7a4f6bac4b, built on 2021-03-17 09:46 UTC | |
zk_server_state leader | |
zk_peer_state leading - broadcast | |
zk_ephemerals_count 80 | |
zk_num_alive_connections 6 | |
zk_avg_latency 0.5714 | |
zk_min_proposal_size 36 | |
zk_outstanding_requests 0 | |
zk_znode_count 508 | |
zk_global_sessions 53 |
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
#!/bin/bash | |
# | |
# ./handleMemoriesUploads.sh /srv/uploads/digitalmemories /mnt/external/managedark/digitalmemories /srv/enc/clear/digitalmemories/ /srv/enc/ciphered/digitalmemories/ azureDrive:/backup/memories false | |
# | |
SOURCE_DIR=$1 | |
LOCAL_DEST=$2 | |
ENC_IN=$3 | |
ENC_OUT=$4 | |
RCLONE_SYNC_DEST=$5 | |
SKIP_UPLOAD=$6 |
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
# https://www.europarl.europa.eu/plenary/en/votes.html?tab=votes | |
curl https://www.europarl.europa.eu/doceo/document/PV-9-2022-03-01-RCV_FR.xml |\ | |
xq . |\ | |
jq '."PV.RollCallVoteResults"."RollCallVote.Result"[] | {"description": ."RollCallVote.Description.Text"."#text", "votes": ."Result.Against"."Result.PoliticalGroup.List"[]}' | |
cat /tmp/votes.json | jq '."PV.RollCallVoteResults"."RollCallVote.Result"[] | select(."RollCallVote.Description.Text"."#text" == "- Après le § 37 - Am 21")| {"description": ."RollCallVote.Description.Text"."#text", "votes": ."Result.For"."Result.PoliticalGroup.List"[]}' | jq '.votes | ."@Identifier", (."PoliticalGroup.Member.Name" | length)' -r |
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
package main | |
// https://go.dev/doc/tutorial/generics | |
import "fmt" | |
func receiveSlice[V interface{}](theSlice []V) []V { | |
ret := make([]V, len(theSlice)) | |
for i, value := range theSlice { | |
ret[i] = value |
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
#!/bin/bash | |
# | |
# ./handleMemoriesUploads.sh /srv/uploads/digitalmemories /mnt/external/managedark/digitalmemories /srv/enc/clear/digitalmemories/ /srv/enc/ciphered/digitalmemories/ amazonDrive:/backup/memories false | |
# ./handleMemoriesUploads.sh /srv/uploads/digitalmemories /mnt/external/managedark/digitalmemories /srv/enc/clear/digitalmemories/ /srv/enc/ciphered/digitalmemories/ s3:orionsmemories | |
# | |
SOURCE_DIR=$1 | |
LOCAL_DEST=$2 | |
ENC_IN=$3 | |
ENC_OUT=$4 | |
RCLONE_SYNC_DEST=$5 |
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
var l = Vector.empty[String] | |
val c = '"' | |
def doit(p: => Unit) { | |
p | |
val ll = "doit {" +: l :+ "}" | |
print(ll.mkString("\n")) | |
} | |
def myprint(x: Any) { | |
l = l :+ s"myprint($c$c$c$x$c$c$c)" | |
println(x) |
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 $ivy.`com.typesafe:config:1.4.0` | |
import com.typesafe.config.ConfigFactory | |
import scala.collection.JavaConverters._ | |
ConfigFactory.parseString(repl.clipboard.read) | |
.entrySet.asScala.map(_.getKey).toSeq.sorted | |
.filter(_.contains("timeout")) |
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
#!/bin/bash | |
BLIGHT_PATH=$(sudo find /sys -type d -name intel_backlight) | |
MAX_BRIGHTNESS=$(cat $BLIGHT_PATH/max_brightness) | |
while [ 1 ]; do | |
echo "$MAX_BRIGHTNESS*$(fswebcam --png -1 - | convert - -colorspace gray -format "%[fx:mean]" info:)" | \ | |
bc -l | cut -d '.' -f 1 | \ | |
sudo tee $BLIGHT_PATH/brightness; |
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 java.util.zip.ZipInputStream | |
def zipStream(zis: ZipInputStream, buffer: Array[Byte]): Stream[(String, Array[Byte])] = { | |
val maybeEntry = Option(zis.getNextEntry); | |
maybeEntry match { | |
case Some(entry) => | |
val size = zis.read(buffer, 0, buffer.size) | |
(entry.getName, buffer.take(size)) #:: zipStream(zis, buffer) | |
case None => Stream.empty | |
} |
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 $ivy.`io.circe::circe-parser:0.11.1` | |
import io.circe._, io.circe.parser._, io.circe.syntax._ | |
for { | |
input <- parse(repl.clipboard.read).right | |
toAdd <- parse("""{"new_field": "added programatically"}""").right | |
} repl.clipboard.write(input.deepMerge(toAdd).toString) |
NewerOlder