Skip to content

Instantly share code, notes, and snippets.

View bluebycode's full-sized avatar
👋

Álvaro López bluebycode

👋
View GitHub Profile
@bluebycode
bluebycode / redis_installation.txt
Last active April 8, 2016 15:39
Installing Redis 3.0.7 in Centos 6.x
$ sudo yum group install "Development Tools" -y \
sudo yum install tcl
$ wget http://download.redis.io/releases/redis-3.0.7.tar.gz
$ tar -xvf redis-3.0.7.tar.gz
$ cd redis-3.0.7/deps
$ make hiredis lua jemalloc linenoise
$ cd ../src
$ make && make test
$ sudo make install
@bluebycode
bluebycode / git_working_subtrees.txt
Created March 30, 2016 10:02
Working with desired subtrees on git (sparse-checkout)
# Initialize
# Go project folder (empty) and initialize as git
git init
# Fetch tree
git remote add -f origin http://github.com/vrandkode/scratch.git
# Enable sparse-checkout and configure by listing your desired sub-trees
git config core.sparsecheckout true
echo "path/to/dir" >> .git/info/sparse-checkout
@bluebycode
bluebycode / CheckVersion.cs
Created March 30, 2016 12:05
Check version of dll file using mono CheckVersion.exe <filename.dll>
using System;
using System.Reflection;
namespace Assemblies {
class MainClass
{
public static void Main (string[] args)
{
Console.WriteLine (args[0]);
Assembly assembly = Assembly.LoadFrom(args[0]);
Version ver = assembly.GetName().Version;
@bluebycode
bluebycode / servicename.sh
Last active May 3, 2016 17:23
Service init script + Mono + Executable. servicename <start|stop|status> #bash #initscript #services #mono
service="servicename"
exe="Service.exe"
mono=/usr/local/bin/mono
logs_path=logs
pid_file="/var/run/services/$service.pid"
get_pid() {
cat "$pid_file"
}
@bluebycode
bluebycode / java18_centos.txt
Last active May 3, 2016 17:24
Installing Java 1.8 JDK (Oracle) in Centos #jdk #jdk18 #centos
# Skipping the license
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.rpm"
# Installing the RPM
sudo yum localinstall jdk-8u60-linux-x64.rpm
# Removing the trace
rm jdk-8u60-linux-x64.rpm
# Append JAVA_HOME under .bash_profile
# export JAVA_HOME=/usr/java/jre1.8.0_60
# PATH=$PATH:$JAVA_HOME/bin
@bluebycode
bluebycode / gradle26.txt
Last active May 3, 2016 17:23
Installing Gradle 2.6 #gradle
# Download the binary and installing under /opt
wget https://services.gradle.org/distributions/gradle-2.6-bin.zip
unzip gradle-2.6-bin.zip
mv gradle-2.6 /opt/gradle
# Edit bash profile as following ~/.bash_profile
# export GRADLE_HOME=/opt/gradle/bin
# PATH=$PATH:$GRADLE_HOME
@bluebycode
bluebycode / iptables_allowing.sh
Last active May 3, 2016 17:22
IPTABLES Adding allowing addresses and reject rest them #iptables #portfiltering
sudo iptables --flush
sudo iptables -A INPUT -p tcp -s X.X.X.X --dport 22 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport=22 -j DROP
sudo iptables-save
@bluebycode
bluebycode / mono_centos_installation.txt
Last active May 3, 2016 17:22
Mono 4.2.2 Installation + Centos 6.x #mono
$ yum group install "Development Tools" -y
$ wget http://download.mono-project.com/sources/mono/mono-4.2.2.30.tar.bz2
$ tar jxf mono-4.2.2.30.tar.bz2
$ cd mono-4.2.2
$ ./configure --prefix=/opt/mono
$ make && make install
# Append following lines to profile bash: ~/.bash_profile
$ export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig
$ export PATH=$PATH:/opt/mono/bin
@bluebycode
bluebycode / jar_deployed_run
Last active May 3, 2016 17:22
Extract classes and resources from jar + Run using classpath #java #jar #classpath
mkdir src
/usr/java/jdk1.8.0_60/bin/jar xvf <fat-jar-with-dependencies>.jar
/usr/java/jdk1.8.0_60/bin/java -Dprop=value -cp src com.example.MainClass
@bluebycode
bluebycode / remote_desktop_windows_configuration.txt
Last active May 3, 2016 17:21
Enable multiple remote connection for windows server 2012 #windows #server2012 #rdp
How to enable multiple remote connection for windows server 2012
1. gpedit.msc and open it
2. Go to computer configuration -> Administrative Tempalates -> Wondows Components
-> Remote Desktop services -> Remote Desktop Session Host -> Connections.