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
FROM alpine:3.20 AS build | |
RUN apk --no-cache --update --upgrade add git musl-dev cargo \ | |
&& git clone https://github.com/KaranGauswami/socks-to-http-proxy.git \ | |
&& cd socks-to-http-proxy \ | |
&& cargo build --release | |
FROM alpine:3.20 | |
COPY --from=build /socks-to-http-proxy/target/release/sthp /usr/local/bin/ |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowViewAccountInfo", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:GetAccountPasswordPolicy", | |
"iam:ListVirtualMFADevices" | |
], |
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 { launch } from 'puppeteer'; | |
import fs from 'fs/promises' | |
let messages = []; | |
const eventsToObserve = [ | |
"Network.dataReceived", | |
"Network.eventSourceMessageReceived", | |
"Network.loadingFailed", | |
"Network.loadingFinished", | |
"Network.requestServedFromCache", |
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 python | |
#coding: utf8 | |
# | |
# | |
# xml2dict | |
# ============ | |
# | |
# Convert XML to dict. | |
# |
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 perl | |
use strict; | |
use warnings; | |
use Getopt::Long 2.24 qw( :config bundling no_ignore_case no_auto_abbrev ); | |
my ( $N, $EXT, @EXT, @USE, $DECODE, $ENCODE ); | |
sub compile { eval shift } # defined early to control the lexical environment | |
my $msglevel = 0; |
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 perl | |
use strict; | |
use warnings; | |
use Getopt::Long 2.24 qw( :config bundling no_ignore_case no_auto_abbrev ); | |
my ( $N, $EXT, @EXT, @USE, $DECODE, $ENCODE ); | |
sub compile { eval shift } # defined early to control the lexical environment | |
my $msglevel = 0; |
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
# Check if FILES contain lines ending with whitespaces | |
perl -Mopen=IO,:raw -ne 'print "$ARGV $.\n" if /\s\R/; $.=0 if eof;' FILES | |
# shuffle lines | |
perl -MList::Util=shuffle -e 'print shuffle <>' | |
# random string | |
perl -le 'print map chr 33 + rand 94, 1..pop||20' 50 |
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
perl -Mopen=IO,:raw -ne 'chop; print "$ARGV\@$.: $_\n" if /\s$/' |
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
# for i in 3.5 3.6 3.7 3.8 3.9;do docker run -ti --rm -v ~/main.go:/go/main.go golang:alpine$i /bin/sh -c "go build main.go; time -v ./main > /dev/null; go version";done; | |
Command being timed: "./main" | |
User time (seconds): 0.00 | |
System time (seconds): 0.00 | |
Percent of CPU this job got: 50% | |
Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 0.00s | |
Average shared text size (kbytes): 0 | |
Average unshared data size (kbytes): 0 | |
Average stack size (kbytes): 0 | |
Average total size (kbytes): 0 |
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
<?php | |
$a = array('<foo>',"'bar'",'"baz"','&blong&', "\xc3\xa9", "中文"); | |
echo "Normal: ", json_encode($a), "\n"; | |
echo "Tags: ", json_encode($a, JSON_HEX_TAG), "\n"; | |
echo "Apos: ", json_encode($a, JSON_HEX_APOS), "\n"; | |
echo "Quot: ", json_encode($a, JSON_HEX_QUOT), "\n"; | |
echo "Amp: ", json_encode($a, JSON_HEX_AMP), "\n"; | |
echo "Unicode: ", json_encode($a, JSON_UNESCAPED_UNICODE), "\n"; | |
echo "All: ", json_encode($a, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE), "\n\n"; |
NewerOlder