Skip to content

Instantly share code, notes, and snippets.

@kasng
kasng / Xvfb systemd service.org
Last active July 11, 2024 11:08
Ubuntu start xvfb on boot #ubuntu

Xvfb systemd service

System environment

  • CentOS 8.0
  • Xvfb 1.20
@kasng
kasng / hide_meta_boxes.php
Created September 28, 2016 03:26
Hide all meta boxes in post type
<?php
/**
* Hide all metaboxes in the global $wp_meta_boxes
*/
add_filter( 'hidden_meta_boxes', function( $hidden, $screen, $use_defaults )
{
global $wp_meta_boxes;
$cpt = 'post'; // Modify this to your needs!
import boto3
import re
import datetime
ec = boto3.client('ec2')
iam = boto3.client('iam')
"""
This function looks at *all* snapshots that have a "DeleteOn" tag containing
the current day formatted as YYYY-MM-DD. This function should be run at least
import boto3
import collections
import datetime
ec = boto3.client('ec2')
def lambda_handler(event, context):
reservations = ec.describe_instances(
Filters=[
{'Name': 'tag-key', 'Values': ['backup', 'Backup']},
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:*"
],
"Resource": "arn:aws:logs:*:*:*"
},