Skip to content

Instantly share code, notes, and snippets.

View anselal's full-sized avatar
🐧
/dev/null

Anastasios Selalmazidis anselal

🐧
/dev/null
View GitHub Profile
@anselal
anselal / custom.js
Last active August 29, 2015 14:11 — forked from drewjoh/custom.js
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {
@anselal
anselal / PATH
Created November 27, 2016 17:56
# Add ever folder under $HOME/bin to PATH
PATH=$PATH$( find $HOME/bin/ -type d -printf ":%p" )
# MLP for Digits Dataset with cross validation
from keras.models import Sequential, model_from_json
from keras.layers import Dense, Dropout
from keras.callbacks import ModelCheckpoint
from keras.constraints import maxnorm
from keras.wrappers.scikit_learn import KerasClassifier
from keras.utils import np_utils
from keras import backend as K
from keras.callbacks import TensorBoard
from keras.optimizers import SGD
@anselal
anselal / scp_demo.py
Last active October 23, 2017 10:38 — forked from mlafeldt/scp_demo.py
[Python] paramiko examples
#!/usr/bin/env python
import sys, paramiko
if len(sys.argv) < 5:
print "args missing"
sys.exit(1)
hostname = sys.argv[1]
password = sys.argv[2]
@anselal
anselal / tunnel.py
Created October 23, 2017 10:36 — forked from tonicebrian/tunnel.py
Paramiko tunnel
# Create a SSH connection
import paramiko
import os
ssh = paramiko.SSHClient()
ssh._policy = paramiko.WarningPolicy()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_config = paramiko.SSHConfig()
user_config_file = os.path.expanduser("~/.ssh/config")
@anselal
anselal / example.py
Created October 23, 2017 10:40
[Python] paramiko
# SFTP
import paramiko
channel = paramiko.Transport(('host', 22))
channel.connect(username='username', password='password')
client = paramiko.SFTPClient.from_transport(channel)
client.chdir('/tmp')
print(client.getcwd())
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anselal
anselal / tmux.md
Created May 17, 2018 09:57 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@anselal
anselal / tmux.conf
Created May 30, 2018 07:40 — forked from rajanand02/tmux.conf
Tmux configurations with status bar theme
# set prefix to control-f
set -g prefix C-f
#unbind system defined prefix
unbind C-b
# helps in faster key repetition
set -sg escape-time 0
# start session number from 1 rather than 0
@anselal
anselal / .vimrc
Created May 30, 2018 10:32 — forked from ericbn/.vimrc
Vim Powerline-like status line without the need of any plugin
" Statusline (requires Powerline font)
set statusline=
set statusline+=%(%{&buflisted?bufnr('%'):''}\ \ %)
set statusline+=%< " Truncate line here
set statusline+=%f\ " File path, as typed or relative to current directory
set statusline+=%{&modified?'+\ ':''}
set statusline+=%{&readonly?'\ ':''}
set statusline+=%= " Separation point between left and right aligned items
set statusline+=\ %{&filetype!=#''?&filetype:'none'}
set statusline+=%(\ %{(&bomb\|\|&fileencoding!~#'^$\\\|utf-8'?'\ '.&fileencoding.(&bomb?'-bom':''):'')