// Not only Object but also other types. (Function, Array, String, Number, ...)
Object.prototype.prop1 = 1;
Object.prototype.func1 = () => 'Hello!';
const obj1 = {};
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
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "v1", | |
"title": "ShipEngine" | |
}, | |
"host": "api.shipengine.com", | |
"schemes": [ | |
"https" | |
], |
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
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | |
// https://scotthelme.co.uk/content-security-policy-an-introduction/ | |
// scanner: https://securityheaders.com/ | |
const rootDomain = `your-domain.com`; // or your server IP for dev | |
const directives = { | |
'img-src': [ | |
"*", | |
"'self'", |
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
#!/bin/bash | |
#qemu-img create -f qcow2 disk.qcow2 20G | |
#qemu-img create -f qcow2 varstore.img 128M | |
debian_iso=debian-9.6.0-arm64-xfce-CD-1.iso | |
qemu-system-aarch64 -smp cpus=6 -M virt -cpu max -m 2G -nographic \ | |
-drive file=QEMU_EFI.img,if=pflash,format=raw \ | |
-drive file=varstore.img,if=pflash \ | |
-drive file=disk.qcow2,if=virtio \ | |
-drive file=$debian_iso,if=virtio,format=raw |
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
/* | |
* Libevent is a high-performance and portable asynchronous networking I/O library (http://libevent.org) | |
* This is small program to demonstrate the basic of libevent programming | |
* | |
* Copyright (C) 2012, Ardhan Madras <ardhan@rocksis.net> | |
*/ | |
#include <event.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> |
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
// Core assets | |
let coreAssets = []; | |
// On install, cache core assets | |
self.addEventListener('install', function (event) { | |
// Cache core assets | |
event.waitUntil(caches.open('app').then(function (cache) { | |
for (let asset of coreAssets) { | |
cache.add(new Request(asset)); |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: pihole-config | |
data: | |
WEBPASSWORD: pihole | |
TZ: 'Asia/Ho_Chi_Minh' | |
DNS1: 1.1.1.1 | |
DNS2: 1.0.0.1 |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
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
#!/bin/bash | |
## Update fail2ban iptables with globally known attackers. | |
## Actually, runs 100% independently now, without needing fail2ban installed. | |
## | |
## /etc/cron.daily/sync-fail2ban | |
## | |
## Author: Marcos Kobylecki <fail2ban.globalBlackList@askmarcos.com> | |
## http://www.reddit.com/r/linux/comments/2nvzur/shared_blacklists_from_fail2ban/ |
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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: ubuntu | |
labels: | |
app: ubuntu | |
spec: | |
containers: | |
- image: ubuntu | |
command: |
OlderNewer