Skip to content

Instantly share code, notes, and snippets.

View relaxdiego's full-sized avatar
🤓

Mark Maglana relaxdiego

🤓
  • The Linux Foundation
  • Earth, Solar System, Milky Way, Laniakea
View GitHub Profile
kind: List
apiVersion: v1
items:
- kind: Namespace
apiVersion: v1
metadata:
name: guestbook
- kind: Deployment
GIT_VERSION=`git --version | awk '{print $3}'`
URL="https://raw.github.com/git/git/v$GIT_VERSION/contrib/completion/git-completion.bash"
PROFILE="$HOME/.bash_profile"
echo "Downloading git-completion for git version: $GIT_VERSION..."
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
fi
@relaxdiego
relaxdiego / in_main.py
Last active January 7, 2019 08:55
Initialize in main() vs outside main()
#!/usr/bin/python
from ansible.module_utils.basic import AnsibleModule
def main():
mod = AnsibleModule(
argument_spec=dict(
url=dict(required=True),
dest=dict(required=False, default="/tmp/firstmod")
)
#!/bin/bash
set -e
arch=${1:-amd64}
repo=${2:-"http://ftp.us.debian.org/debian/dists/stable/main"}
url="${repo}/Contents-${arch}.gz"
gz_path="$HOME/.deb_content_files/$(sed -r 's|https?://||g' <<< $url)"
txt_path=${gz_path/%.gz/}
Nov 29 08:54:22 raspberrypi domotzpro-agent-publicstore.domotzpro-agent-publicstore[1530]: ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Nov 29 08:54:22 raspberrypi domotzpro-agent-publicstore.domotzpro-agent-publicstore[1530]: ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Nov 29 08:54:24 raspberrypi domotzpro-agent-publicstore.domotzpro-agent-publicstore[1530]: Skip the Updater simulation, status=(ubuntu_core,undefined)
Nov 29 08:54:24 raspberrypi domotzpro-agent-publicstore.domotzpro-agent-publicstore[1530]: MAIN - Start agent [2.8.1-b001] at Fri Nov 29 2019 08:54:24 GMT+0000 (GMT)
Nov 29 08:54:24 raspberrypi domotzpro-agent-publicstore.domotzpro-agent-publicstore[1530]: MAIN - +------------------------------------------------+
Nov 29 08:54:24 raspberrypi domotzpro-agent-publ
mmaglana@localhost:~$ sudo cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu Core 18"
mmaglana@localhost:~$ sudo cat /etc/os-release
NAME="Ubuntu Core"
VERSION="18"
ID=ubuntu-core
mmaglana@localhost:~$ sudo -i
root@localhost:~# cd /var/snap/domotzpro-agent-publicstore/common/log
root@localhost:/var/snap/domotzpro-agent-publicstore/common/log# ls -al
total 8
drwxr-xr-x 2 root root 4096 Dec 5 02:59 .
drwxr-xr-x 5 root root 4096 Dec 5 02:59 ..
root@localhost:/var/snap/domotzpro-agent-publicstore/common/log# systemctl | grep domotz
@relaxdiego
relaxdiego / golang-tls.md
Last active January 8, 2020 06:46 — forked from denji/golang-tls.md
OpenSSL TLS

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
#
# setup ssh-agent
#
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
[2020-02-04T01:47:28.257] [info] [rpc] gRPC listening on unix:/var/run/multipass_socket, SSL:on
[2020-02-04T01:47:28.267] [warning] [url downloader] Cannot retrieve last modified date for http://cloud-images.ubuntu.com/releases/streams/v1/index.json: Host cloud-images.ubuntu.com not found. Using cached data instead.
[2020-02-04T01:47:28.273] [warning] [url downloader] Cannot retrieve last modified date for http://cloud-images.ubuntu.com/releases/streams/v1/com.ubuntu.cloud:released:download.json: Host cloud-images.ubuntu.com not found. Using cached data instead.
[2020-02-04T01:47:28.587] [info] [update] Failed to fetch update info: failed to download from 'https://multipass.run/static/latest-release.json': Host multipass.run not found
[2020-02-04T01:47:28.691] [warning] [url downloader] Cannot retrieve last modified date for http://cloud-images.ubuntu.com/daily/streams/v1/index.json: Host cloud-images.ubuntu.com not found. Using cached data instead.
[2020-02-04T01:47:28.692] [warning] [url downloader] Cannot