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 is not async | |
(defn shell | |
[cmd] | |
(->> (.. Runtime getRuntime (exec cmd) getInputStream) | |
java.io.InputStreamReader. | |
java.io.BufferedReader. | |
line-seq | |
(map str))) | |
; or this is async, use this as script to test it: |
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
class Node: | |
def __init__(self, data=None): | |
self.data = data | |
self.next = None | |
def __str__(self): | |
return str(self.data) | |
class SinglyLinkedList: |
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
def retun_unique(lst): | |
return [i for i in lst if lst.count(i) <= 1] | |
return_unique([1, 9, 8, 8, 7, 6, 1, 6]) # -> [9, 7] | |
return_unique([5, 5, 2, 4, 4, 4, 9, 9, 9, 1]) # -> [2, 1] | |
return_unique([9, 5, 6, 8, 7, 7, 1, 1, 1, 1, 1, 9, 8]) # -> [5, 6] |
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
pkgs: attrs: | |
with pkgs; | |
let defaultAttrs = { | |
builder = "${bash}/bin/bash"; | |
args = [ ./builder.sh ]; | |
setup = ./setup.sh; | |
# binutils-unwrapped provides the ar utility | |
baseInputs = [ gnutar gzip gnumake gcc binutils-unwrapped coreutils gawk gnused gnugrep patchelf findutils ]; | |
buildInputs = []; | |
system = builtins.currentSystem; |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSNWB3aMMJ9skVQKZMzIMHBZaqzD0vdDMb/vEsxA9tWkC5ch7RHXlvT10RaAKQy4eGfL1Os2d9MACvZiqsJ68RzgqP4nWIA/F8kxsPHfBY1WJRKPn/nxW+HHisA2LUts/yIYuK6lszMj/UVFCiaIpd9VDe9MOq1sDHxMS4PnyaWwXIxQ9Ua8Ioj93J9ld2pFwQPSAhWuTg5H7k+MbQgdjNxrZyNNd5bbXQsAlpN7K4gtmf9MWhWpN8HoIDPnz/C/VnzcQasQnkYu4kuuI4yMo7dd4vbttWW5df8w0d1yHmfetglQbj1Ht6Y2fn/skUL7Deqf5JnZlR0Gti4VkoJwih vaevictis | |
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA8VVs+gk0ZFbNbx1tnRGTHFD2OBXGOW7yaMUWMXABF7ONM6iN7SwMdioFNvlPkha6UwPtXlYc+59fI21ExW4Th1IGfhanDMvV61AeR3JQmEuwljBAlEZ779OefupHaWwlMOWUBE7mHZCXgUHZbUom6sL8GCQ0smpnyuQNwcpMEN2YxhbU6d3gowKHgixiJXMkcRCqX5QHNtmVCh9kp6lJNoWrmLJT0W9d6aQhX+laui95D89cFifsyo8fHkADew3PIZ9qyqUTQUrP9MC5PFV9wUA9hds3PaMKbPsEh5a69s4MZ8PxK/Qq5t0FqZDp+3EqNzO1Nz2DkoHRt69aMjsGYw== [email protected] | |
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArxPOycq84YnVKRQt3JIon0sgE8s1oPh2qwCISum77+9NMITZ37gS/+gTXgGcuIGPkz1GxGGg/giWqnw/t/XmGNoPD4rqT14EnXnh7wphl+ABxOwAn6NTyIR0VELhMLNvpj9C+VD8YGa9ICMkgAxIK9flI5E9aEgnja9AmaJ5el8jVO0cTTeijFvU228OzOV8gLvTxRjak+JqZ+ |
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
fn fib(x: u64) -> u64 { | |
if x > 1 { fib(x - 1) + fib(x - 2) } else { x } | |
} | |
fn main() { | |
println!("Result {}", fib(10)); // -> 55 | |
} |
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
{ | |
// Configure the daemon below: | |
"options": { | |
"host_identifier": "scw-xxxxxxx", | |
"config_plugin": "filesystem", | |
// Select the osquery logging plugin. | |
"logger_plugin": "aws_kinesis", | |
"enable_monitor": "true", | |
// Splay the scheduled interval for queries. |
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.4 | |
# skip installing gem documentation | |
RUN mkdir -p /usr/local/etc \ | |
&& { \ | |
echo 'install: --no-document'; \ | |
echo 'update: --no-document'; \ | |
} >> /usr/local/etc/gemrc | |
ENV RUBY_MAJOR 2.4 |
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
require "openssl" | |
class Chef | |
class Recipe | |
def self.certificate_expired?(path) | |
OpenSSL::X509::Certificate.new(File.open(path, "rb").read).not_after <= Time.now | |
end | |
end | |
end |
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
REPORT=/tmp/ssh_acl.txt | |
for user in $(knife data bag show users) | |
do | |
knife data bag show users $user | grep -v ssh_keys | grep -v ssh-rsa | grep -v htpasswd | grep -v shell >> $REPORT | |
echo "---------------------" >> $REPORT | |
done |
NewerOlder