Skip to content

Instantly share code, notes, and snippets.

ALTER TABLESPACE

ALTER USER username TEMPORARY TABLESPACE temp_tablespace_name;
ALTER USER username DEFAULT TABLESPACE tablespace_name;

SHOW TABLESPACE USAGE

select df.tablespace_name "Tablespace",
       totalusedspace "Used MB",

(df.totalspace - tu.totalusedspace) "Free MB",

RENAMING SESSIONS:

C-a :sessionname mySessionName

Screen's -X switch lets you rename a session without attaching it.

screen -X sessionname foobars

LIST RUNNING SESSIONS:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@rolandvarga
rolandvarga / flush-dns.sh
Created July 19, 2017 15:47 — forked from craigvantonder/flush-dns.sh
Flushing the DNS in Ubuntu 16.04
#!/bin/bash
# run this command to flush dns cache:
sudo /etc/init.d/dns-clean restart
# or use:
sudo /etc/init.d/networking force-reload
# Flush nscd dns cache:
sudo /etc/init.d/nscd restart
# If you wanted to refresh your settings you could disable and then run
sudo service network-manager restart
@rolandvarga
rolandvarga / MySQL_macOS_Sierra.md
Created February 17, 2019 19:33 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

#/bin/bash
# https://github.com/segmentio/terraform-docs/releases/tag/v0.7.0
curl https://github.com/segmentio/terraform-docs/releases/download/v0.7.0/terraform-docs-v0.7.0-darwin-amd64 --output terraform-docs
mv /usr/local/bin/terraform-docs /usr/local/bin/old.terraform-docs
mv terraform-docs /usr/local/bin/terraform-docs
# change to whatever permissions you feel comfortable with
chmod 777 /usr/local/bin/terraform-docs
func InitializeEverything() {
objectA := NewObjectACollector()
objectB := NewObjectBCollector()
objectC := NewObjectCCollector()
objectD := NewObjectDCollector()
objectE := NewObjectECollector()
objectF := NewObjectFCollector()
objectG := NewObjectGCollector()
objectH := NewObjectHCollector()
objectI := NewObjectICollector()
func InitializeCollector(i int) func() {
return [...]interface{}{
NewObjectACollector,
NewObjectBCollector,
NewObjectCCollector,
NewObjectDCollector,
NewObjectECollector,
}[i].(func())
}
func main() {
for i := 0; i <= collectorCount; i++ {
InitializeCollector(i)()
}
}
package main
import (
"fmt"
)
const (
collectorCount = 4
)