Skip to content

Instantly share code, notes, and snippets.

@RichVRed
RichVRed / gitcreate.sh
Created August 27, 2016 22:03 — forked from jerrykrinock/gitcreate.sh
This script create a new repo on github.com, then pushes to it the local repo from the current directory.It is a fork of https://gist.github.com/robwierzbowski/5430952/. Some of Rob's lines just didn't work for me, and to fix them I needed to make it more verbose so that a mere electrical engineer could understand it.
#!/bin/bash
# This script create a new repo on github.com, then pushes the local repo from the current directory to the new remote.
# It is a fork of https://gist.github.com/robwierzbowski/5430952/. Some of Rob's lines just didn't work for me, and to fix them I needed to make it more verbose so that a mere electrical engineer could understand it.
# This script gets a username from .gitconfig. If it indicates that your default username is an empty string, you can set it with
# git config --add github.user YOUR_GIT_USERNAME
# Gather constant vars
@RichVRed
RichVRed / linux_fun.md
Created January 9, 2017 20:26 — forked from marianposaceanu/linux_fun.md
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
@RichVRed
RichVRed / install.sh
Last active November 4, 2018 14:40 — forked from jtilly/install.sh
Install QCacheGrind on Ubuntu
#!/bin/bash
sudo apt-get install qt5-default
wget http://kcachegrind.sourceforge.net/kcachegrind-0.7.4.tar.gz
tar xvf kcachegrind-0.7.4.tar.gz
cd kcachegrind-0.7.4
qmake && make
sudo install -m 755 qcachegrind/qcachegrind /usr/local/bin
sudo install -m 644 qcachegrind/qcachegrind.desktop \
/usr/local/share/applications/
@RichVRed
RichVRed / vm-resize-hard-disk.md
Created January 31, 2017 17:46 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@RichVRed
RichVRed / gitlab-version-chech.sh
Created March 31, 2017 15:45 — forked from samrocketman/gitlab-version-chech.sh
A simple bash script for checking the latest stable version of GitLab
#!/bin/bash
#Sam Gleske
#Mon Apr 28 11:11:10 EDT 2014
#Red Hat Enterprise Linux Server release 6.5 (Santiago)
#Linux 2.6.32-431.el6.x86_64 x86_64
#GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
#DESCRIPTION
# Check the latest stable version and compare with the version of gitlab installed.
# Run daily via cron.
@RichVRed
RichVRed / gist:fe4e2e718256a431cbdd531a66fe676d
Created April 25, 2017 22:10 — forked from songlipeng2003/gist:3366275
reset mysql root password without no password in ubuntu
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# Check if user is root
if [ $(id -u) != "0" ]; then
printf "Error: You must be root to run this script!\n"
exit 1
fi
@RichVRed
RichVRed / MariaDBInstall.sh
Created April 27, 2017 21:09 — forked from mamemomonga/MariaDBInstall.sh
Install MariaDB Client 10.1 for Debian8, Ubuntu 16.04
#!/bin/bash
# ----------
# Install MariaDB Client 10.1 for Debian8, Ubuntu 16.04
# curl -L https://gist.githubusercontent.com/mamemomonga/2823ecc2b20b886e90d1b8d523515724/raw/MariaDBInstall.sh | sudo bash -eux
# ----------
set -eux
if [ `id --user` -ne 0 ]; then
echo "rootでの実行が必要"
exit 255
select ix.owner, ix.index_name, ix.table_name,
ix.distinct_keys, ix.leaf_blocks,
s.blocks as segment_blocks,
s.bytes / 1048576 as size_in_mb,
to_char(ix.last_analyzed, 'YYYY-MM-DD HH24:MI') as last_analyzed
from all_indexes ix, dba_segments s
where ix.owner = s.owner and ix.index_name = s.segment_name
order by ix.table_name, ix.index_name;
select column_name, avg_col_len, num_distinct, num_nulls
from all_tab_columns
where table_name = '<<table name>>'
order by column_id desc;
-- table info is only as up to date as last time stats were gathered (last_analyzed)
select t.owner, t.table_name, t.num_rows, t.avg_row_len,
t.blocks as blocks_below_hwm, t.empty_blocks,
s.blocks as segment_blocks,
s.bytes / 1048576 as size_in_mb,
to_char(t.last_analyzed, 'YYYY-MM-DD HH24:MI') as last_analyzed
from all_tables t, dba_segments s
where t.owner = s.owner and t.table_name = s.segment_name
and t.owner = 'SCHEMA_NAME';