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::time::{Duration, Instant}; | |
| struct Limiter { | |
| instant: Option<Instant>, | |
| duration: Duration, | |
| } | |
| impl Limiter { | |
| pub fn new(secs: u64) -> Limiter { | |
| Limiter { |
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
| #![allow(unused_variables)] | |
| use futures::future::LocalBoxFuture; | |
| use futures::prelude::*; | |
| use std::path::Path; | |
| use tokio::fs::*; | |
| fn walkdir<'a, C>(path: &'a Path, cb: &'a mut C) -> LocalBoxFuture<'a, ()> | |
| where | |
| C: Fn(&DirEntry), | |
| { |
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
| 1: ~/.config/nvim/init.vim | |
| 2: ~/.local/share/nvim/site/autoload/plug.vim | |
| 3: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/filetype.vim | |
| 4: ~/.vim/plugged/vim-fugitive/ftdetect/fugitive.vim | |
| 5: ~/.vim/plugged/vim-javascript/ftdetect/flow.vim | |
| 6: ~/.vim/plugged/vim-javascript/ftdetect/javascript.vim | |
| 7: ~/.vim/plugged/typescript-vim/ftdetect/typescript.vim | |
| 8: ~/.vim/plugged/ultisnips/ftdetect/snippets.vim |
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 futures::future::Future; | |
| struct MyStruct { | |
| msg: String, | |
| } | |
| impl MyStruct { | |
| fn new(msg: String) -> Self { MyStruct{ msg } } | |
| } |
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
| #![allow(unused_imports)] | |
| use super::config::Machine; | |
| use super::email; | |
| use futures::future::join_all; | |
| use log; | |
| use std::io; | |
| use std::process::{Command, ExitStatus}; | |
| use tokio::task::spawn_blocking; | |
| fn run_cmd(cmd: &'static str, args: Vec<&str>) -> io::Result<ExitStatus> { |
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
| from unittest import TestCase, main | |
| from unittest.mock import patch | |
| # import monkeypatch | |
| from logging import getLogger | |
| log = getLogger('foo') |
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 <assert.h> | |
| #include <string.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stddef.h> | |
| /* | |
| * You can get the offset of a member on a struct by dereferencing that member on | |
| * address 0 of such structure. | |
| */ |
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
| package content | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "github.com/ponzu-cms/ponzu/management/editor" | |
| "github.com/ponzu-cms/ponzu/system/item" | |
| ) |
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
| curl -X POST 'http://localhost/xcatws/tokens?pretty=1' -H 'Content-type: application/json' --data "{ \"userName\": \"root\", \"userPW\": \"$(/opt/xcat/sbin/tabdump passwd | grep '^"system' | cut -f3 -d, | sed 's/"//g')\" }" |
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
| mkdir -p /opt/versatushpc/{etc,xcat} | |
| mkdir -p /opt/versatushpc/xcat/post{install,scripts} | |
| copycds CentOS-7-x86_64-DVD-1810.iso | |
| cat <<'EOF' > /opt/versatushpc/xcat/postinstall/add-cluster-key | |
| #!/bin/bash | |
| pubkey=$(cat ~/.ssh/id_ed25519.pub) | |
| authorized_keys="$IMG_ROOTIMGDIR/root/.ssh/authorized_keys" | |
| if [ ! -f $authorized_keys ]; then |