Skip to content

Instantly share code, notes, and snippets.

@bmwant
bmwant / ansbile_tips.yml
Last active July 9, 2021 09:53
ansible quick tips for some modules
# Check existing
- name: Ansible check file exists.
stat:
path: /etc/filename
register: file_status
- debug:
msg: "File exists..."
when: file_status.stat.exists
- debug:
msg: "File not found"
@grimzy
grimzy / git-pull-all
Created September 15, 2017 02:15
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
global glob
import glob, re
class dstat_scboot(dstat):
def __init__(self):
self.name = 'scboot monitor'
self.format = ('d', 6, 100)
self.vars = ('count', 'kernel', 'fabric', 'preinit', 'slurm')
self.nick = ('secs', 'kernel', 'fabric', 'initfs', 'slurm')
#self.vars = ('count', 'kernel', 'fabric', 'preinit', 'slurm', 'logins')
@truatpasteurdotfr
truatpasteurdotfr / bootstrap-c6-bazel-from-c7.def
Created March 16, 2017 21:12
singularity definition to build a centos6 container from a centos7 host
#!/bin/bash
#
# Copyright (c) 2015-2016, Gregory M. Kurtzer. All rights reserved.
#
# "Singularity" Copyright (c) 2016, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy). All rights reserved.
#
# Tru Huynh <[email protected]>
@cmavr8
cmavr8 / secure-ssh.yml
Last active January 4, 2024 19:52
Secure SSH configuration ansible playbook. Last updated years ago, NOT recommended for use. There are better ways to do this today.
---
# SSH server settings, in line with https://stribika.github.io/2015/01/04/secure-secure-shell.html
# Before using, change myhosts to your hosts' nickname and myuser to your username (two instances! make sure you replace both or you'll be locked out of ssh!)
- hosts: myhosts
become: true
remote_user: myuser
tasks:
# Key exchange, ciphers and MACs
- lineinfile: dest=/etc/ssh/sshd_config regexp='^KexAlgorithms' line='KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256'
@truatpasteurdotfr
truatpasteurdotfr / gist:c160ffaa4b46a47ad196220194e715f0
Created February 17, 2017 13:32
vagrant-virtualbox-singularity-osx.txt
# install vagrant
macmini:vagrant tru$ VERS=1.9.1
macmini:vagrant tru$ curl https://releases.hashicorp.com/vagrant/${VERS}/vagrant_${VERS}.dmg > vagrant_${VERS}.dmg
macmini:vagrant tru$ curl https://releases.hashicorp.com/vagrant/${VERS}/vagrant_${VERS}_SHA256SUMS > vagrant_${VERS}_SHA256SUMS
macmini:vagrant tru$ grep vagrant_${VERS}.dmg vagrant_${VERS}_SHA256SUMS | shasum -a 256 -c && \
macmini:vagrant tru$ hdiutil mount vagrant_${VERS}.dmg && \
macmini:vagrant tru$ sudo installer -pkg /Volumes/Vagrant/Vagrant.pkg -target /
macmini:vagrant tru$ hdiutil unmount /Volumes/Vagrant
# installing VirtualBox
macmini:vagrant tru$ VERSVB=5.1.14
@mnarayan
mnarayan / backup_sherlock.md
Last active December 19, 2023 03:12
MATLAB on sherlock

How to backup data from sherlock to google drive

  1. Download and install rclone to your $HOME/bin directory. Setup up rclone to connect to your google drive. Suppose you call your remote google drive drive.

  2. Create a bash script called backup_gdrive.sh with the following information

#!/bin/sh

STUDY_DIR=STUDY
LOCAL_DIR=${SCRATCH}/${STUDY_DIR}
@chrhuber
chrhuber / nullQueue Example
Last active April 16, 2017 20:38
Splunk Summary Indexing Licence Usage
[debug_log_transform]
REGEX=DEBUG\s[
DEST_KEY = queue
FORMAT = nullQueue
Link https://answers.splunk.com/answers/11617/route-unwanted-logs-to-a-null-queue.html
@muresan
muresan / Vagrantfile
Created November 23, 2016 16:37
Simple "run a CentOS 7 box for Splunk" Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
#TODO
Vagrant.configure(2) do |config|
hosts = {
'splunk01' => { 'ip' => '192.168.124.201', 'cpus' => 1, 'memory' => 2048, 'autostart' => true },
# 'splunk02' => { 'ip' => '192.168.124.202', 'cpus' => 1, 'memory' => 2048, 'autostart' => true },
}
@miglen
miglen / 2016-devops-conf-playlist.md
Last active June 23, 2018 10:08
2016 DevOps Conferences - Video playlists