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
--- | |
- hosts: all | |
tasks: | |
- command: ls /tmp | |
register: files | |
- debug: msg="{{ item }}" | |
with_items: "{{ files.stdout_lines[-3:] }}" |
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
void ICACHE_FLASH_ATTR scan_cb(void *arg, STATUS status) { | |
uint8 bssid[6]; | |
uint8 ssid[33]; | |
sint8 rssi; | |
uint8 best_bssid[6]; | |
uint8 best_ssid[33]; | |
sint8 best_rssi; | |
if (status == OK) { | |
rssi = 0; |
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
require 'net/http' | |
require 'stringio' | |
urls = [ | |
'http://www.greglangford.co.uk', | |
'https://www.greglangford.co.uk/docker-compose-unable-to-connect-to-port/', | |
'https://www.greglangford.co.uk/stm8-8-bit-timer-configuration/' | |
] | |
def get_body(url) |
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
require 'net/http' | |
urls = [ | |
'http://www.greglangford.co.uk' | |
] | |
def request(url, method) | |
uri = URI(url) | |
response_is_not_redirect = false |
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
function fetch(request) { | |
validateRequest(request); | |
let url = request.url; | |
let userAgent = request.userAgent || null; | |
let timeout = request.timeout || 10000; | |
let waitUntil = request.waitUntil || 'networkidle2'; | |
return new Promise(function(resolve, reject) { | |
puppeteer.launch({executablePath: chromiumBrowserExecutable}).then(function(browser) { |
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
- command: some command here | |
register: some_command_here_output | |
- debug: | |
msg: '{{ some_command_here_output }}' | |
# only run if needed | |
- command: some command here | |
when: some_command_here_output.stdout is search('string in the stdout of the some command here command') |
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/bash | |
log() { | |
local type="$1"; shift | |
printf '%s [%s] : %s\n' "$(date --rfc-3339=seconds)" "$type" "$*" | |
} | |
log_info() { | |
log INFO "$@" | |
} |
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
- hosts: localhost | |
connection: local | |
tasks: | |
- debug: | |
msg: '{{ __virt_install_disks }}' | |
vars: | |
__virt_install_disks: >- | |
{% if __x is not defined -%} |
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 "mbedtls/net_sockets.h" | |
#include "mbedtls/ssl.h" | |
#include "mbedtls/error.h" | |
#include "mbedtls/entropy.h" | |
#include "mbedtls/ctr_drbg.h" | |
#include <arpa/inet.h> // inet_addr | |
#include <stdio.h> // printf, fgets | |
#include <netinet/in.h> // sockaddr, sockaddr_in |