echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -ex | |
toolset=devtoolset-7 | |
yum install -y epel-release # EPEL repo | |
yum install -y centos-release-scl # shiny-new(er) compliers | |
# make sure there are no surprises installing from repos | |
grep -r gpgkey= /etc/yum.repos.d/ | cut -d= -f2 | xargs -L1 rpm --import | |
yum update -y # system update | |
# misc dev tools, but we're not going to use the ancient toolchain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To execute any linux command in background we use nohup. But the problem with scp command is that it prompts for the password (if password authentication is used). So to make scp execute as a background process do this: | |
1> | |
$ nohup scp file_to_copy user@server:/path/to/copy/the/file > nohup.out 2>&1 | |
if it prompts for password then enter password. | |
Then press ctrl + z which will temporarily suspend the command, | |
SCP will give output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install libmpc-devel mpfr-devel gmp-devel | |
cd /usr/src/ | |
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.3/gcc-4.9.3.tar.bz2 -O | |
tar xvfj gcc-4.9.3.tar.bz2 | |
cd gcc-4.9.3 | |
./configure --disable-multilib --enable-languages=c,c++ | |
make -j `grep processor /proc/cpuinfo | wc -l` | |
make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage | |
# First create an encrypted password to be used as connection pass | |
# and pass as a parameter with the script. To create use: slappasswd | |
# Clean packages | |
sudo yum clean all | |
# Install openldap as service manager | |
sudo yum -y install openldap-servers openldap-clients |
This is a quick set-up guide on how to install Icecast for Mp3 and Ogg streaming, sort of online radio. Tested on Debian Wheezy. Probably works on Ubuntu, etc. Icecast is a "server-like". It offers the HTTP URL/port through which end-users can play the media. However, Icecast itself does not serve the files. It must get its input from other "client-like" software. For example, Ices0 sends mp3 input to Icecast and then Icecast delivers to the end user. Similarly, Ices2 sends ogg input to Icecast and then Icecast delivers to the end user.
Start by installing:
sudo apt-get install icecast2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide | |
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources | |
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
tar xzvf yasm-1.2.0.tar.gz | |
cd yasm-1.2.0 |