Skip to content

Instantly share code, notes, and snippets.

View Akasurde's full-sized avatar
🌏
To the infinity and beyond

Abhijeet Kasurde Akasurde

🌏
To the infinity and beyond
View GitHub Profile
apiVersion: v1
kind: Pod
metadata:
labels:
app: pod6
name: pod6
namespace: default
spec:
containers:
- args:
---
- hosts: localhost
gather_facts: no
vars:
name: "abhi"
tasks:
- name: Print variable
debug:
msg: "{{ name }}"
@Akasurde
Akasurde / ndef_example.py
Created July 7, 2022 14:39
Encode and decode ndef message
import ndef
import codecs
text_record = (ndef.TNF_WELL_KNOWN, ndef.RTD_TEXT, b'id', b'hello world')
text_message = ndef.new_message(text_record)
text_raw_ndef = text_message.to_buffer()
encoded_hello_world = codecs.encode(text_raw_ndef, 'hex_codec')
decoded_hello_world = codecs.decode(encoded_hello_world, 'hex_codec')
@Akasurde
Akasurde / ndef_multiple_record_example.py
Created July 7, 2022 14:53
Encode and decode multiple records
import ndef
import codecs
text_record = (
(ndef.TNF_WELL_KNOWN, ndef.RTD_TEXT, b'id', b'hello world'),
(ndef.TNF_WELL_KNOWN, ndef.RTD_TEXT, b'id', b'hello world 2'),
(ndef.TNF_URI, ndef.RTD_URI, b'id', b'https://github.com'),
)
text_message = ndef.new_message(*text_record)
text_raw_ndef = text_message.to_buffer()
- name: Remove nth element from the list
debug:
msg: |
{% set _ = my_list.pop(index) %}
{{ my_list }}
vars:
my_list: [1, 2, 3, 4, 5, 6]
index: 2
- name: Remove nth element from the list by value using reject
debug:
msg: "{{ my_list | reject('search', value)}}"
vars:
my_list: [1, 2, 3, 4, 5, 6]
value: '2'
- name: Remove nth element from the list by value
debug:
msg: |
{% set _ = my_list.remove(value) %}
{{ my_list }}
vars:
my_list: [1, 2, 3, 4, 5, 6]
value: 2
#!/bin/sh
rfolder=/mnt/sdcard/DCIM/Camera
adb shell ls "${rfolder}" > android.files
lfolder=/Volumes/data/documents/personal/camera
ls -1 "${lfolder}" > local.files
[
{
"children": [
{
"children": [
{
"children": [
{
"children": [],
"event": "runner_on_start",
from api_helper import ShoonyaApiPy, get_time
import logging
import yaml
import pandas as pd
import pyotp
import asyncio
import json
import websockets