Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@CsBigDataHub
CsBigDataHub / proj2ram
Created May 17, 2022 18:12 — forked from redguardtoo/proj2ram
script to copy project to tmpfs
#!/bin/sh
if [ -z "$1" ];then
echo "Usage:"
echo " proj2ram proj-name"
echo " proj2ram restore proj-name"
exit 1
fi
@CsBigDataHub
CsBigDataHub / k8s-jprofiler-attach.sh
Created August 27, 2021 14:24 — forked from adiii717/k8s-jprofiler-attach.sh
Attach JProfiler agent to a JVM running in a Kubernetes pod
#!/bin/bash
set -ex
usage()
{
echo "usage: k8s-jprofiler-attach.sh pod_name"
}
k8s_jvm_pod="${1}"
control 'azurerm_resource_groups' do
describe azurerm_resource_groups do
its('names') { should include 'myResourcegroup' }
end
end
control 'azurerm_virtual_machine' do
describe azurerm_virtual_machine(resource_group: 'MyResourceGroup', name: 'prod-web-01') do
it { should exist }
it { should have_monitoring_agent_installed }
it { should have_only_approved_extensions(['MicrosoftMonitoringAgent']) }
its('type') { should eq 'Microsoft.Compute/virtualMachines' }
its('installed_extensions_types') { should include('MicrosoftMonitoringAgent') }
its('installed_extensions_names') { should include('LogAnalytics') }
its('properties.location') { should eq 'northeurope'}
control "subnet" do
describe azurerm_subnet(resource_group: 'MyResourceGroup', vnet: 'vnet-prod', name: 'subnet-web') do
it { should exist }
its('address_prefix') { should eq '192.168.0.0/24' }
its('nsg') { should eq 'my-nsg'}
end
end
@CsBigDataHub
CsBigDataHub / gist:48b3f4cd71833046adbdea2e6a10f704
Created June 26, 2021 02:03 — forked from daicham/gist:1955543
Print the methods of Jenkins inner object on script console
//all job name
jenkins.model.Jenkins.instance.items.each {
println "Job: ${it.name}"
}
//method list of Jenkins instance
jenkins.model.Jenkins.instance.class.methods.each {
println "Jenkins method: ${it.name}"
}
@CsBigDataHub
CsBigDataHub / pass.md
Created January 28, 2021 19:15 — forked from abtrout/pass.md
Using password-store with git repository synching

Password-store keeps your passwords (or any other sensitive information) saved in GnuPG encrypted files organized in ~/.password-store. For more information about GPG, consult the GNU Privacy Handbook.

Getting started

To get started, install pass and generate a keypair.

$ brew install pass
$ gpg --gen-key
$ gpg --list-keys
@CsBigDataHub
CsBigDataHub / gccemacs.md
Created October 15, 2020 01:35 — forked from AllenDang/gccemacs.md
Build gccemacs on MacOS catalina with gcc 10 installed by homebrew.
@CsBigDataHub
CsBigDataHub / gccemacs_osx.md
Created October 15, 2020 01:33 — forked from mikroskeem/gccemacs_osx.md
gccemacs on OSX

gccemacs on OS X

Read this first: http://akrl.sdf.org/gccemacs.html

Prerequisites

1) GCC with libgccjit enabled

For that you need to compile gcc (duh). I edited Homebrew's gcc formula:

function errexit() {
local err=$?
set +o xtrace
local code="${1:-1}"
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err"
# Print out the stack trace described by $function_stack
if [ ${#FUNCNAME[@]} -gt 2 ]
then
echo "Call tree:"
for ((i=1;i<${#FUNCNAME[@]}-1;i++))