Skip to content

Instantly share code, notes, and snippets.

@kenanpelit
kenanpelit / bash-cheatsheet.sh
Created October 29, 2016 21:22 — 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
@kenanpelit
kenanpelit / myweechat.md
Created November 9, 2016 21:45 — forked from pascalpoitras/config.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

Enable mouse support

/mouse enable

Encrypted password in sec.conf

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

Installing Arch:
sudo vim /etc/pacman.conf
Update packages list: sudo pacman -Syy
run sudo pacman -Syu before installing any software (to update the repositories first)
* Timing issue:
- Change hardware clock to use UTC time:
sudo timedatectl set-local-rtc 0
@kenanpelit
kenanpelit / Arch-Linux-Kurulumu
Created November 27, 2016 15:16 — forked from mertcangokgoz/Arch-Linux-Kurulumu
Güncel ArchLinux Kurulumudur.Türkiyedeki Linux sevenler için tekrardan düzenlenmiş versiyonudur.dm-crypt kullanılarak HDD şifreleme imkanı sağlanmıştır UEFI Modu içindir.
# ArchLinux Kurulumu (UEFI ve Şifreli HDD)
# Translated and Modified: (https://gist.github.com/mattiaslundberg/8620837)
# Resmi Kurulum Dokümantasyonu için (https://wiki.archlinux.org/index.php/Installation_Guide)
# Son sürüm iso dosyasını resmi sitesinden indirin https://www.archlinux.org/
# İso kalıbını USB diskimize yazdırıyoruz.
dd if=archlinux.img of=/dev/sdb bs=16M && sync # USB ismi ARCH_2015xx şeklinde olmalı örng: ARCH_201509
# Ardından Secure Boot seçeneği devredışı bırakılmış bir şekilde Boot işlemini gerçekleştirin.
@kenanpelit
kenanpelit / sp
Created December 17, 2016 13:29 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
package = "cutorch"
version = "scm-1"
source = {
url = "git://github.com/torch/cutorch.git",
}
description = {
summary = "Torch CUDA Implementation",
detailed = [[
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
StartupNotify=true
Icon=/usr/local/rapidminer/resources/com/rapidminer/resources/rapidminer_frame_icon_128.png
Name=RapidMiner
Comment=Rapid miner
Exec=/usr/local/rapidminer/scripts/RapidMinerGUI
Categories=Development;IDE;
@kenanpelit
kenanpelit / LXC_HOWTO.markdown
Created June 25, 2017 19:34 — forked from EnigmaCurry/LXC_HOWTO.markdown
Linux Containers mini-HOWTO on Ubuntu

This is a mini-HOWTO for setting up Linux Containers (LXC) on Ubuntu. This guide focuses on the creation of a web server with good process isolation and firewalling.

Dependencies

apt-get install lxc

Create a container