Skip to content

Instantly share code, notes, and snippets.

View uphy's full-sized avatar
💭
I may be slow to respond.

Yuhi Ishikura uphy

💭
I may be slow to respond.
View GitHub Profile
@uphy
uphy / deliverable.cue
Created October 14, 2022 02:45
CUE: File content injection
#Embed: {
files: [string]: string
}
#Resource: {
#embed: [string]: #Embed | *{}
...
}
#Deliverable: {
@uphy
uphy / zoom-mute.py
Created December 22, 2021 04:52
Mute Zoom Audio
import subprocess
def set_zoom_audio_muted(muted:bool):
subprocess.run("""osascript -e '
on setAudioMuted(muted)
activate application "zoom.us"
delay 0.5
tell application "System Events"
tell process "zoom.us"
tell window "Zoomミーティング"
@uphy
uphy / fold.css
Created September 24, 2021 01:08
Hide Obsidian's fold marker
.CodeMirror-gutter-elt {
display: none;
}
.CodeMirror-activeline .CodeMirror-gutter-elt {
display: block;
}
@uphy
uphy / ConnectTimeout.java
Created October 10, 2018 10:05
Artifically create connection timeout error
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.SocketTimeoutException;
import java.net.URL;
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
URL url = new URL("http://10.255.255.1:8080");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setConnectTimeout(1000);
@uphy
uphy / config.yml
Created April 9, 2018 08:56
chackerv1config
service1:
host: host1
commands:
status:
steps:
- type: upload
local: foo/bar
remote: /tmp/hoge
- type: script
script: |
@uphy
uphy / node-red-multiline-shellscript.json
Last active December 14, 2020 15:36
Node-RED Execute multiline shell script
[{"id":"1a73c740.e06d79","type":"subflow","name":"Execute Shell Script","info":"","in":[{"x":100,"y":200,"wires":[{"id":"662c3c62.43d624"}]}],"out":[{"x":960,"y":280,"wires":[{"id":"9e92978.d8d0868","port":0}]},{"x":960,"y":340,"wires":[{"id":"9e92978.d8d0868","port":1}]},{"x":960,"y":400,"wires":[{"id":"9e92978.d8d0868","port":2}]}]},{"id":"dda86e6b.3b362","type":"file","z":"1a73c740.e06d79","name":"Write script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"false","x":860,"y":140,"wires":[]},{"id":"7a2a96f.a52b268","type":"exec","z":"1a73c740.e06d79","command":"mktemp","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":420,"y":200,"wires":[["9131a546.667eb8"],[],[]]},{"id":"c9fb5364.0becc","type":"file","z":"1a73c740.e06d79","name":"Delete script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"delete","x":1020,"y":480,"wires":[]},{"id":"9e92978.d8d0868","type":"exec","z":"1a73c740.e06d79","command":" sh ","addpay":true,"append":"","useS
@uphy
uphy / mkdocs.yml
Created April 10, 2017 10:52
mkdocs.yml
site_name: My Docs
site_description: hogehoge
site_author: uphy
copyright: my copyright
dev_addr: 0.0.0.0:8000
theme: readthedocs
markdown_extensions:
- footnotes
pages:
@uphy
uphy / logstash-free.conf
Created March 9, 2017 12:39
logstash - free command
input {
exec {
command => "free -b"
interval => 10
}
}
filter {
grok {
match => {
"message" => ".*?Mem:\s*?%{NUMBER:total}\s*?%{NUMBER:used}\s*?%{NUMBER:free}\s*?%{NUMBER:shared}\s*?%{NUMBER:buffers}\s*?%{NUMBER:cached}\s*?\-/\+ buffers/cache:\s*?%{NUMBER:actual.used}\s*?%{NUMBER:actual.free}\s*?Swap:\s*?%{NUMBER:swap.total}\s*?%{NUMBER:swap.used}\s*?%{NUMBER:swap.free}.*"
package jp.uphy.wso2apim;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
import javax.net.ssl.HttpsURLConnection;
import org.apache.commons.httpclient.Header;
import org.wso2.carbon.endpoint.stub.types.EndpointAdminEndpointAdminException;
import org.wso2.carbon.registry.info.stub.RegistryExceptionException;
import org.wso2.carbon.registry.resource.stub.ResourceAdminServiceExceptionException;
import org.wso2.carbon.registry.resource.stub.ResourceAdminServiceStub;
import org.wso2.carbon.rest.api.stub.RestApiAdminAPIException;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Base64;