Skip to content

Instantly share code, notes, and snippets.

View rameshz23's full-sized avatar

ram rameshz23

View GitHub Profile
@luckydev
luckydev / to_show_git_branch_and_ruby_version
Created September 24, 2010 08:07
how to display ruby version and git branch in terminal prompt
export PS1="\[\033[00m\]\u@\h\[\033[00m\]:\[\033[00m\]\w\[\033[00m\] \`ruby -e \"print (%x{git branch 2> /dev/null}.split(%r{\n}).grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[00m\]$\[\033[00m\] "
PS1="\$(~/.rvm/bin/rvm-prompt) $PS1"
@pushmon
pushmon / gist:1886142
Last active June 18, 2018 17:26
Batch File
rem
rem Please download curl from https://curl.haxx.se/download.html and add it to your path.
rem
@echo on
rem if command fails, exit and do not ping
if %errorlevel% neq 0 goto ERROR
set URL_STRING=http://pshmn.com/eaFnY
curl %URL_STRING%
@rkulla
rkulla / co
Last active December 3, 2021 11:12
Bash script for easier SVN checkouts
#!/bin/bash
# Author Ryan Kulla (rkulla@gmail.com)
#
# A shell script (in Bash) that allows you to do SVN checkouts
# with a shorter command than the default subversion command.
# Handy if your repos have long, hard to remember URLs.
#
# Put this script in your PATH (e.g., ~/bin/)
# Make sure it's executable:
# $ chmod u+x ~/bin/co
@adamenger
adamenger / knife.rb
Last active July 7, 2020 17:34
knife.rb example
knife[:chef_repo_path] = "#{ENV['HOME']}/.chef"
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name ENV['USER']
client_key "#{knife[:chef_repo_path]}/#{ENV['USER']}.pem"
validation_client_name "chef-validator"
validation_key "#{knife[:chef_repo_path]}/chef-validator.pem"
chef_server_url "https://chef.example.com/organizations/#{ENV['ORGNAME']}"
@maxivak
maxivak / readme.md
Last active March 22, 2023 12:03
Chef. How to run scripts (recipes)

Run Chef scripts locally

There are several options to run recipes:

  • using chef-client with -z option
  • using chef-apply
  • using chef-solo

Before running Chef recipes on the machine, it should be prepared:

@rameshz23
rameshz23 / powerssh.ps1
Created July 26, 2018 12:55 — forked from sveinn-steinarsson/powerssh.ps1
Use Powershell to connect to a remote server via SSH and run a shell script/command
# Script Name: powerssh
# Version: 1.1.0 (9. July, 2014)
# Author: Sveinn Steinarsson
# Description: Use Powershell to connect to a remote server via SSH and run a shell script/command
# Prerequisite:
# plink.exe in script path (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
# Examples:
# With key file (*.ppk) and script file