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 | |
set -o errexit | |
clear | |
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n" | |
### HOW TO USE | |
### Pre-req: | |
### - run on a Proxmox 6 server | |
### - a dhcp server should be active on vmbr1 |
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
Explanations: | |
cache: If you include other words in the query, Google will highlight those words within | |
the cached document. For instance, [cache:www.google.com web] will show the cached | |
content with the word “web” highlighted. This functionality is also accessible by | |
clicking on the “Cached” link on Google’s main results page. The query [cache:] will | |
show the version of the web page that Google has in its cache. For instance, | |
[cache:www.google.com] will show Google’s cache of the Google homepage. Note there | |
can be no space between the “cache:” and the web page url. | |
------------------------------------------------------------------------------------------ |
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
`ʕ•͡ᴥ•ʔ ʕ•͡ᴥ•ʔ ʕ•͡ᴥ•ʔ` | |
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 std/parseopt | |
import hashes | |
import sets | |
import sequtils | |
var p = initOptParser("-ab -c:123 -d xyz -e:5 --foo --bar=20 file.txt") | |
var cmdline: OrderedSet[string] = initOrderedSet[string]() | |
while true: | |
p.next() |
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 python3 | |
# -*- encoding: UTF-8 -*- | |
# Copyright(c) 2021 Blacknon. All rights reserved. | |
# Use of this source code is governed by an MIT license | |
# that can be found in the LICENSE file. | |
# | |
# User: | |
# blacknon | |
# Description: [hwatch](https://github.com/blacknon/hwatch)のlogをパースして出力するスクリプト | |
# ============================================= |
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 python3 | |
# -*- encoding: UTF-8 -*- | |
import itertools | |
options = { | |
"x": ["a", "b"], | |
"y": [10, 20, 30]} | |
keys = options.keys() | |
values = (options[key] for key in keys) |
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 python3 | |
# -*- encoding: UTF-8 -*- | |
import re | |
colourFormat = '\033[{0}m' | |
colourStr = colourFormat.format(32) | |
resetStr = colourFormat.format(0) | |
s = "This is a sentence where I talk about interesting stuff like sencha tea." | |
lastMatch = 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 python3 | |
# -*- encoding: UTF-8 -*- | |
import chromedriver_autoinstaller | |
import time | |
import re | |
import demjson | |
from bs4 import BeautifulSoup | |
from selenium import webdriver |
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 python3 | |
# -*- encoding: UTF-8 -*- | |
from prompt_toolkit import prompt | |
from prompt_toolkit.completion import FuzzyWordCompleter | |
# 単語の候補 | |
my_completer = FuzzyWordCompleter( | |
["apple", "goole", "japan", "hoge", "hello world", "good morning"] | |
) |
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
// Copyright (c) 2020 Blacknon. All rights reserved. | |
// Use of this source code is governed by an MIT license | |
// that can be found in the LICENSE file. | |
// `github.com/miekg/pkcs11/p11`を使って、Yubikey内からsshのCryptoSignerを取得するサンプルコード | |
package main | |
import ( | |
"crypto/rsa" |
NewerOlder