Skip to content

Instantly share code, notes, and snippets.

View ivoarch's full-sized avatar

ivoarch (Ivaylo Kuzev) ivoarch

View GitHub 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 / create_rpmrepo.sh
Created October 1, 2014 19:54
Create RPM Repository for Rhel/CentOS
#!/bin/bash
# Create RPM Repository for Rhel/CentOS
ftpdir="$HOME/Dropbox/Public/rpmrepo"
releases=(el6 el7)
for release in "${releases[@]}"; do
for dir in i386 x86_64 SRPMS; do
pushd "${ftpdir}/${release}/${dir}" >/dev/null 2>&1
createrepo -v .
--- NetworkManager.conf.orig 2014-10-26 10:19:18.398880201 +0100
+++ NetworkManager.conf 2014-10-26 09:37:06.646255367 +0100
@@ -12,6 +12,12 @@
<allow send_destination="org.freedesktop.NetworkManager"
send_interface="org.freedesktop.NetworkManager.PPP"/>
</policy>
+ <!-- My hack -->
+ <policy group="network">
+ <allow send_destination="org.freedesktop.NetworkManager"
+ send_interface="org.freedesktop.NetworkManager"/>
@ivoarch
ivoarch / wtime.sh
Last active August 29, 2015 14:08
Световното време от терминала.
#!/bin/bash
# само за bash
shopt -s expand_aliases
clear;
alias datetime="date +'%a-%d-%b,%H:%M'"
echo -e 'Колко е часът във Европа?'
echo -e '==========================='
@ivoarch
ivoarch / install_firefox-i18n.sh
Last active August 29, 2015 14:08
Install any version of Firefox browser with your language pack (on Linux) so fast.
#!/bin/bash
# Install any version of Firefox browser with your language pack (on Linux) so fast.
# Autor: Ivaylo Kuzev (@ivoarch) 2014
# Init
if [ ! $# -eq 2 ]; then
echo "usage: sudo $0 version locale"
echo "example: sudo $0 31.2.0esr bg"
exit 1;
fi
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
<title>TITLE</title>
#!/bin/bash
arch=$(uname -m)
if [ "$arch" == "x86_64" ]; then
pushd /usr/lib64/firefox/langpacks
else
pushd /usr/lib/firefox/langpacks
fi
unzip [email protected] install.rdf >/dev/null
sed -i '/./,$!d' install.rdf
@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.