Skip to content

Instantly share code, notes, and snippets.

View bluebycode's full-sized avatar
👋

Álvaro López bluebycode

👋
View GitHub Profile
@bluebycode
bluebycode / git_undo_remote_commit
Created May 3, 2016 16:47
Git Undo remote commit #git #revert #commit
#commit a739014b596c8feff37426cb8ff22d72aad86bcb
# Author: vrandkode <vrandkode@gmail.com>
# adding base domain trace. last commit
#commit de12d72f1edeb3fca500e3aab2e884a2a48ffd05
# Author: vrandkode <vrandkode@gmail.com>
# working commit
# git push <remote> +<commit-id>^:<branch>
# revert to commit's parent: de12d72f
@bluebycode
bluebycode / port_redirection_iptables
Last active August 19, 2024 07:15
Port forwarding from 443 to 22 using iptables #iptables #forward #redirection
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 22
@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.
@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 / 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 / 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 / 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 / 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 / servicename.sh
Last active August 2, 2024 06:26
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 / 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;