Skip to content

Instantly share code, notes, and snippets.

@notz
notz / create-db-statement.sql
Created June 3, 2024 14:39
mysql create copy database statments
SET @NewSchema := "www-staging-1";
SET @OldSchema := "www";
SELECT CONCAT("DROP TABLE IF EXISTS `", @NewSchema, "`.`", table_name, "`;\nCREATE TABLE `", @NewSchema, "`.`",table_name, "` LIKE `", TABLE_SCHEMA , "`.`", table_name, "`;\nINSERT INTO `",@NewSchema, "`.`", table_name, "` SELECT * FROM `", TABLE_SCHEMA , "`.`", table_name, "`;")
AS `sql` FROM information_schema.TABLES WHERE TABLE_SCHEMA = @OldSchema AND TABLE_TYPE != "VIEW";
@notz
notz / gist:008f089e7a9a366f653d7b0a23a788eb
Created May 17, 2023 09:36
Merge two kubeconfig files
KUBECONFIG=~/.kube/config:~/downloads/kubeconfig.yml kubectl config view --flatten > ~/.kube/config
@notz
notz / gist:de4a4ef0a2332bc48c052fa71dcd7a3f
Created November 23, 2017 21:06
Merge githup pull request
curl https://patch-diff.githubusercontent.com/raw/sonyxperiadev/kernel/pull/1522.patch | git am
@notz
notz / strings-merge.py
Created February 14, 2017 17:40
Merges iOS fallback strings for not translated strings (jenkins build step)
#!/usr/local/bin/python3.5
# -*- coding: utf-8 -*-
from nslocalized import StringTable
import glob
import re
def merge(source, destination):
try:
st = StringTable.read(source)
@notz
notz / submit_sms_websms
Created February 18, 2016 20:24
Opsview websms.com notification plugin
#!/usr/bin/perl -w
#
#
# SYNTAX:
my $usage = qq{
submit_sms_websms
Copyright (C) 2003-2015 Opsview Limited. All rights reserved
Usage: submit_sms_websms -a access_token [-s Opsview] [-t alphanumeric] [-m num] [-n]
Options:
import com.hazelcast.client.HazelcastClient;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.config.Config;
import com.hazelcast.config.GroupConfig;
import com.hazelcast.config.MapConfig;
import com.hazelcast.config.NearCacheConfig;
import com.hazelcast.core.*;
import java.util.concurrent.atomic.AtomicInteger;
@notz
notz / mongos
Last active December 16, 2015 03:29 — forked from fabioperrella/mongos
#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.