Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#changes line endings from windows to unix for file
sed -i 's/\r$//' /tmp/filename.txt
#!/bin/bash
hostname=$1
publicIP=$2
privateIP=$3
#change hostname and ip in /etc/sysconfig/network and /etc/hosts
cp -f /etc/hosts.bak /etc/hosts
cp -f /etc/sysconfig/network.bak /etc/sysconfig/network
sed -i "s/xxhostnamexx/$hostname/g" /etc/sysconfig/network /etc/hosts
sed -i "s/xxpublicipxx/$publicIP/g" /etc/hosts
@simond
simond / oracle_sessions.sh
Created May 8, 2017 01:12
Show a list of currently running oracle sessions using a shell script
#!/bin/ksh
#########################################################################
# Script Name : oracle_sessions.sh
# Notes : List all ACTIVE database sessions
#########################################################################
sqlplus -s <<- !
/ AS SYSDBA
SET LINES 160
SET PAGES 1000
/************************************************
Tablespace Information
*************************************************/
--Show tablespace usage information
col "Tablespace" for a40
col "Used MB" for 99,999,999
col "Free MB" for 99,999,999
col "Total MB" for 99,999,999
SELECT df.tablespace_name "Tablespace",
@simond
simond / gist:8704067
Created January 30, 2014 07:23
Toolkit that uses the Paramiko ssh library to do a bunch of stuff like download files, hash files etc.
import paramiko
import shutil
import hashlib
import os
class Server:
def __init__(self, hostname='', port=0, username='', password=''):
self.hostname = hostname
self.port = port
self.username = username