Skip to content

Instantly share code, notes, and snippets.

@tatapbl4
tatapbl4 / updates.sh
Created November 19, 2015 17:29
List packages to update with old and new version
apt-get --just-print upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s\[([\w,\-,\d,\.,~,:,\+]+)\]\s\(([\w,\-,\d,\.,~,‌​:,\+]+)\)? /i) {print "PROGRAM: $1 INSTALLED: $2 AVAILABLE: $3\n"}' | column -s " " -t
@tatapbl4
tatapbl4 / make.sh
Last active July 5, 2016 22:35 — forked from artzub/make.sh
Install JetBrains Hub + YouTrack + UpSource + Nginx
#!/bin/bash
apt-get install mc htop git unzip wget curl -y
echo
echo "====================================================="
echo " WELCOME"
echo "====================================================="
echo
echo "Hub"
# Analyze [n]-adapter [t]-transponder [f]-frequency [p]-polarization [sr]-symbol rate [d]-diseqc {} - optional
astra --analyze "dvb://#adapter=[n]&type=[t]&tp=[f]:[p]:[sr]&budget&diseqc=[d]{&lnb=10750:10750:10750}"
$LogInsightServer = "tcp:|udp://fqdn-or-ip:514"
Get-VMHost | Foreach {
Write-Host "Adding $LogInsightServer as Syslog server for $($_.Name)"
$SetSyslog = Set-VMHostSyslogServer -SyslogServer $LogInsightServer -VMHost $_
Write-Host "Reloading Syslog on $($_.Name)"
$Reload = (Get-ESXCLI -VMHost $_).System.Syslog.reload()
Write-Host "Setting firewall to allow Syslog out of $($_)"
$FW = $_ | Get-VMHostFirewallException | Where {$_.Name -eq 'syslog'} | Set-VMHostFirewallException -Enabled:$true
@tatapbl4
tatapbl4 / pedantically_commented_playbook.yml
Created February 5, 2016 20:30 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
$ilocreds = Get-Credential
Find-HPiLO 192.168.200.1-255 | Where {$_.FWRI -lt 2.44 -AND $_.PN -like "*iLO 4*"} | Update-HPiLOFirmware -Credential $ilocreds -Location C:\firmware\ilo4\ilo4_244.bin

Keybase proof

I hereby claim:

  • I am tatapbl4 on github.
  • I am mrmaxhate (https://keybase.io/mrmaxhate) on keybase.
  • I have a public key ASCd-IN4XFvQTkKzws0xMMhUor9qJjOg1Vtr3lJOMRSp-Qo

To claim this, I am signing this object:

@tatapbl4
tatapbl4 / delremopen.sh
Created October 5, 2017 18:38
remove deleted but still opened file for rhel6
# https://access.redhat.com/solutions/2316
lsof | grep deleted | awk '{print $8}' | xargs sum 2> /dev/null | awk '{ SUM += $2 } END { print SUM }'
#!/bin/sh
print_usage() {
echo "Usage:"
echo " Create a top level structure: 'create_ansible_structure.sh [TOP_DIRECTORY_PATH]'"
echo " Create a role structure: 'create_ansible_structure.sh role [TOP_DIRECTORY_PATH] [ROLE_NAME]'"
}
error() {
echo "Error: ${1}"