Skip to content

Instantly share code, notes, and snippets.

View lae's full-sized avatar
☠️
untreated medical emergency sena please assist

lae

☠️
untreated medical emergency sena please assist
View GitHub Profile
@lae
lae / kirakiratter.css
Last active April 15, 2017 05:53
Kirakiratter Stylesheet for Mastodon
/* Mastodon: Kirakiratter Custom CSS V7.1
By Salil Gupta (@MasterDalK)
Other Contributors: @pomo, @sumire, @bitmap, @hisagi, @lae
Feature Requests & Bug Reports: #kktCSS on kirakiratter.com
使用方法: http://qiita.com/emerald_magic/items/27d233870e04d791fe2b
For use on Mobile (EN): https://kirakiratter.com/@bitmap/4076
For Desktop use: Same as above or use extension "Stylish". Tested to work in Chrome/Opera/Vivaldi/Firefox/Safari.
There are some toggles at the top, if you would like to disable them just comment as needed.
@lae
lae / disable-twitter-previews.css
Created April 27, 2017 15:09
hides media on twitter behind spoiler text
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("twitter.com") {
.js-media-container,
.AdaptiveMedia {
display: none;
}
.permalink-tweet .AdaptiveMedia,
.permalink-tweet .js-media-container {
display: block;
@lae
lae / configuration.py
Last active June 13, 2017 22:30
Looping through Ansible/YAML dict for Django configuration
# Ansible managed
DATE_FORMAT = "N j, Y"
BANNER_BOTTOM = "Your banner text"
LOGIN_REQUIRED = True
MAX_PAGE_SIZE = 500
PREFER_IPV4 = False
PAGINATE_COUNT = 100
BASE_PATH = "netbox/"
TIME_ZONE = "UTC"
ADMINS = [

Monacoin activates SegWit

first published on Core Media on 2017.04.27

The first cryptocurrency developed in Japan, Monacoin, has surpassed the SegWit activation threshold.

Born from the depths of 2ch, Japan's most popular text board, in the December of 2013, the Monacoin community has become the backbone of the cryptocurrency community in Japan. As a result of SegWit's activation, hopes for further developments, including some off-chain solutions, are beginning to rise within the Monacoin community.

Moreover, the perception of cryptocurrency by the Japanese public is gradually improving, thanks to the involvement of big businesses and the Financial Services Agency. Now that there are proper venues for registration, cryptocurrencies can be officially recognized by the government, which helps to significantly reduce the barrier to entry to crypto for Japanese developers. With this combination of new and existing crypto develope

#!/bin/bash
for certificate in certs/*; do
expiration_date=$(openssl x509 -noout -dates -in $certificate | grep -oP "(?<=notAfter=).*")
remaining_validity_seconds=$(($(date -d "$expiration_date" +%s) - $(date +%s)))
remaining_validity_in_days=$(($remaining_validity_seconds / 86400))
if [ $remaining_validity_in_days -lt 30 ]; then
echo $(basename $certificate .pem);
fi
done
@lae
lae / dr-provision-tasks.yml
Last active April 17, 2018 19:22
dr-provision ansible role (tasks file only)
---
# tasks file for provision
- name: Install necessary packages for DR Provision
apt:
name: "{{ item }}"
state: latest
update_cache: yes
with_items:
- unzip
- p7zip-full
>>> h = re.search('^(127\.0\.0\.1 (?!hello\.local hello( pvelocalhost)?$)|(?!127\.0\.0\.1)[\w.]*\b(hello\.local|hello)\b.*)', "127.2.0.1 hello.local")
>>> h
>>> h = re.search('^(127\.0\.0\.1 (?!hello\.local hello( pvelocalhost)?$)|(?!127\.0\.0\.1)[\w.]*\s+(hello\.local|hello)\b.*)', "127.2.0.1 hello.local")
>>> h
>>> h = re.search('^(127\.0\.0\.1 (?!hello\.local hello( pvelocalhost)?$)|(?!127\.0\.0\.1)[\w.]*\b(hello\.local|hello)(\s*|\s+.*))', "127.2.0.1 hello.local")
>>> h
>>> h = re.search('^(127\.0\.0\.1 (?!hello\.local hello( pvelocalhost)?$)|(?!127\.0\.0\.1)[\w.]*\s+(hello\.local|hello)(\s*|\s+.*))', "127.2.0.1 hello.local")
>>> h
<_sre.SRE_Match object at 0x7fbe68e30c00>
@lae
lae / part-seed-default.tmpl
Created October 11, 2017 00:14
debian/ubuntu drp preseed changes
{{if .ParamExists "operating-system-disk" -}}
d-i partman-auto/disk string {{.Param "operating-system-disk"}}
d-i grub-installer/choose_bootdev select {{.Param "operating-system-disk"}}
d-i grub-installer/bootdev string {{.Param "operating-system-disk"}}
{{else -}}
d-i partman-auto/disk string /dev/sda
d-i grub-installer/choose_bootdev select /dev/sda
d-i grub-installer/bootdev string /dev/sda
{{end -}}
d-i partman-auto/method string regular
#!/usr/bin/python
# -*- coding: utf-8 -*-
ANSIBLE_METADATA = {
'metadata_version': '0.2',
'status': ['preview'],
'supported_by': 'lae'
}
DOCUMENTATION = '''
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/ansible/runner/__init__.py", line 589, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File "/usr/local/lib/python2.7/site-packages/ansible/runner/__init__.py", line 793, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File "/usr/local/lib/python2.7/site-packages/ansible/runner/__init__.py", line 972, in _executor_internal_inner
conn = self.connector.connect(actual_host, actual_port, actual_user, actual_pass, actual_transport, actual_private_key_file, delegate_host)
File "/usr/local/lib/python2.7/site-packages/ansible/runner/connection.py", line 35, in connect
conn = utils.plugins.connection_loader.get(transport, self.runner, host, port, user=user, password=password, private_key_file=private_key_file)
File "/usr/local/lib/python2.7/site-packages/ansible/utils/plugins.py", line 219, in get