Skip to content

Instantly share code, notes, and snippets.

View ivoarch's full-sized avatar

ivoarch

  • none
View GitHub Profile
#!/usr/bin/env bash
dir=$(dirname $0)
gconfdir=/apps/gnome-terminal/profiles
echo # This makes the prompts easier to follow (as do other random echos below)
########################
### Select a profile ###
########################
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
altwin:menu = +altwin(menu)
altwin:meta_alt = +altwin(meta_alt)
altwin:ctrl_win = +altwin(ctrl_win)
altwin:meta_win = +altwin(meta_win)
altwin:left_meta_win = +altwin(left_meta_win)
altwin:super_win = +altwin(super_win)
altwin:hyper_win = +altwin(hyper_win)
altwin:alt_super_win = +altwin(alt_super_win)
altwin:swap_lalt_lwin = +altwin(swap_lalt_lwin)
grp:switch = +group(switch)

Setup Dropbox for system startup

The following instructions will get you setup to run Dropbox at system start. Below, also find instructions on how to install the Dropbox CLI.

# Login as root and go into home dir.
sudo su && cd ~

# Download Dropbox depending on architecture (uname -a) and unpack.
# You will need to repeat this "download and unpack" step for all users
@ivoarch
ivoarch / TrueColor.md
Last active August 29, 2015 14:11 — forked from XVilka/TrueColour.md

Colors in terminal

It's a common confusion about terminal colors... Actually we have this:

  • plain ascii
  • ansi escape codes (16 color codes with bold/italic and background)
  • 256 color palette (216 colors+16gray + ansi) (colors are 24bit)
  • 24bit true color (888 colors (aka 16 milion))

The 256 color palete is configured at start, and it's a 666 cube of colors, each of them defined as a 24bit (888 rgb) color.

# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@ivoarch
ivoarch / png2svg.sh
Last active August 29, 2015 14:28 — forked from ykarikos/png2svg.sh
Convert png to svg using imagemagick and potrace
#!/bin/bash
if [ "$1" == "" ]; then
echo Usage: $0 pngfile
exit 0;
fi
FILE=`basename $1 .png`
if [ ! -e $FILE.png ]; then
@ivoarch
ivoarch / emacs-el6.repo
Last active February 8, 2016 07:50 — forked from AaronTheApe/emacs.repo
Emacs 24 CentOS Repo
[emacs]
name=Emacs repo
baseurl=http://pj.freefaculty.org/EL/6/x86_64/
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=http://pj.freefaculty.org/EL/PaulJohnson-BinaryPackageSigningKey
@ivoarch
ivoarch / bash-cheatsheet.sh
Last active September 5, 2015 21:57 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@ivoarch
ivoarch / xstat
Created November 24, 2015 23:32 — forked from moiseevigor/xstat
xstat bash function to get file creation time on Linux with EXT4
xstat() {
for target in "${@}"; do
inode=$(ls -di "${target}" | cut -d ' ' -f 1)
fs=$(df "${target}" | tail -1 | awk '{print $1}')
crtime=$(sudo debugfs -R 'stat <'"${inode}"'>' "${fs}" 2>/dev/null |
grep -oP 'crtime.*--\s*\K.*')
printf "%s\t%s\n" "${crtime}" "${target}"
done
}