This file contains hidden or 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 static hudson.util.Secret.decrypt | |
void printEntry(credential, attr) { | |
def text = credential."${attr.toLowerCase()}".text() | |
println("${attr}: ${text}") | |
} | |
def text = new File('/var/lib/jenkins/credentials.xml').text | |
def list = new XmlParser().parseText(text).domainCredentialsMap.entry.'java.util.concurrent.CopyOnWriteArrayList'.'*' |
This file contains hidden or 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 os | |
def get_size_dir(path='.'): | |
total_size = 0 | |
for dir_path in os.listdir(path): | |
full_path = os.path.join(path, dir_path) | |
if os.path.isfile(full_path): | |
total_size += os.path.getsize(full_path) | |
elif os.path.isdir(full_path): | |
total_size += get_size_dir(full_path) |
This file contains hidden or 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
#include<stdio.h> | |
#include<stdlib.h> | |
#include<time.h> | |
#define N 10000 | |
#define TRIAL 10000 | |
typedef struct Cell { | |
int value; | |
struct Cell *next; |
This file contains hidden or 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://linuxjm.osdn.jp/html/LDP_man-pages/man2/recvmmsg.2.html in Rust | |
// | |
// 1. Run a receiver. | |
// $ cargo run | |
// 2. Send test data to a receiver. | |
// $ while true; do echo $RANDOM > /dev/udp/127.0.0.1/1234; done | |
use std::mem; | |
use libc::*; |
This file contains hidden or 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
// Just an example. | |
#include<unistd.h> | |
int main() { | |
write(1, "hello\n", 6); | |
} |
This file contains hidden or 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
// Sort release blocker issues to the end. | |
ri := x[i].Issue != nil && x[i].Issue.HasLabel("release-blocker") | |
rj := x[j].Issue != nil && x[j].Issue.HasLabel("release-blocker") | |
if ri != rj { | |
return ri | |
} |
This file contains hidden or 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
use std::rc::Rc; | |
use std::cell::RefCell; | |
/* | |
#[derive(Clone, Debug)] | |
struct Node { | |
val: i32, | |
ptr: Option<Rc<Node>>, | |
} | |
fn new_node(val: i32, ptr: Option<Rc<Node>>) -> Node { |
This file contains hidden or 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
#[derive(Debug)] | |
struct Hoge { | |
a: i32, | |
b: i32, | |
} | |
fn main() { | |
let mut v = Vec::new(); | |
v.push(Hoge{a: 1, b: 2}); | |
v.push(Hoge{a: 2, b: 4}); |
This file contains hidden or 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/sh | |
current=`git log --oneline | wc | awk '{print $1}'` | |
sha1=`git log master --oneline | tail -$((current+1)) | head -1 | awk '{print $1}'` | |
git checkout $sha1 |
NewerOlder