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
const isNullOrEmpty = (value: any) => | |
value == null || | |
(typeof value === 'string' && value.trim() === '') || | |
(Array.isArray(value) && value.length === 0) || | |
(typeof value === 'object' && Object.keys(value).length === 0); | |
export const clearNullEmpties = <T>(obj: T): T => { | |
if (Array.isArray(obj)) { | |
return obj | |
.map(clearNullEmpties) |
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
docker service ls | awk '{print $2}' | xargs -L1 sh -c 'docker service scale $0=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
import json | |
import boto3 | |
import socket | |
def lambda_handler(event, context): | |
client = boto3.client("ec2") | |
ip = socket.gethostbyname("example.com") | |
print("ip:", ip) | |
sg_rules_list = [ |
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
import boto3 | |
import urllib3 | |
# %% Description | |
'''Update the IP address to connect with a VPN that | |
dynamically changes user IPs.''' | |
def lambda_handler(event, context): | |
# %% Get current IP in CIDR notation |
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
import socket | |
domainName = input('Enter the domain name: ') | |
print(socket.gethostbyname(domainName)) |
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 | |
# Finds log4j resources on Linux (tested with Debian) | |
# by Christian Blechert <christian@serverless.industries> | |
# ATTENTION! It only checks ext3 + ext4 filesystems right now! | |
# Extend it if you use something else | |
while read -u 3 -r JAR | |
do |
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
var mandrill = require('mandrill-api/mandrill'); | |
var mandrill_client = new mandrill.Mandrill('api-key'); | |
// Read recipients from file | |
//[ {"email": "me@example.com","name": "Me"} ] | |
var fs = require("fs"); | |
var content = fs.readFileSync("recipients.json"); | |
var recipients = JSON.parse(content); | |
var params = { |
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
User-agent: * | |
Disallow: |
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
#!/usr/bin/env python3 | |
# based on Copyright (c) 2016 Anki, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License in the file LICENSE.txt or at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.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
#!/usr/bin/env python3 | |
# based on Copyright (c) 2016 Anki, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License in the file LICENSE.txt or at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
NewerOlder