Skip to content

Instantly share code, notes, and snippets.

View jbontech's full-sized avatar
:octocat:
Focusing

Jothibasu jbontech

:octocat:
Focusing
View GitHub Profile
@chrisyco
chrisyco / power.sh
Created May 24, 2011 03:38
Suspend, hibernate, restart or shutdown the computer without sudo!
#!/bin/sh
# Suspend, hibernate, restart or shutdown the computer without sudo!
# by Chris Wong
# Released to the public domain.
NAME=$0
usage() {
echo "Usage: $NAME suspend|hibernate|restart|shutdown"
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@emoseman
emoseman / common.gradle
Created June 6, 2012 15:22
Common gradle build
/*
* Common build file for gradle builds.
* To include use:
* apply from: "https://raw.github.com/gist/2882571/2a96a6218b24acbb1e47e87bedab180e2a3ac3ca/common.gradle"
*/
List apachecommons = ["commons-beanutils:commons-beanutils:1.8.3",
"org.apache.commons:commons-lang3:3.1",
"commons-logging:commons-logging:1.1.1"]
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 19:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@matthewlehner
matthewlehner / autopgsqlbackup
Created July 11, 2012 16:10
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form validation example</title>
<style>
input{display:block; margin-bottom:10px;}
</style>
</head>
@jverdeyen
jverdeyen / kvmtemplate.sh
Created August 23, 2012 20:22
KVM template
#!/bin/bash
name=beta
disk=4096
swap=1024
mem=4096
suite=precise
ip="192.168.199.199"
cpu=8
@mjbommar
mjbommar / generate_aws_ssh_config.py
Last active April 20, 2020 13:16
Generate .ssh/config lines from EC2 instance information using boto.
'''
@author Bommarito Consulting, LLC
@date 2012-12-23
Generate .ssh/config lines from EC2 instance information.
'''
# Imports
import boto
import os
@mislav
mislav / _readme.md
Last active June 28, 2024 15:16
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@chilicat
chilicat / scp-ssh.gradle
Last active July 10, 2023 02:53
A simple gradle task to upload a file via SCP to a remote host and to execute a command via SSH on a remote host.
repositories { mavenCentral() }
configurations { sshAntTask }
dependencies { sshAntTask 'org.apache.ant:ant-jsch:1.9.2' }
ant.taskdef(
name: 'scp',
classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
classpath: configurations.sshAntTask.asPath)