This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-------------------------------------------------------------------------------------------- | |
# if found on gist use `git clone https://gist.github.com/650d59476b86fbe885e66af953099006.git .` | |
# this is a modified version of Emmanuel Rouat [no-email] bashrc how to which can be found at | |
# `http://tldp.org/LDP/abs/html/sample-bashrc.html` | |
#-------------------------------------------------------------------------------------------- | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
#------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "openssl" | |
require "digest" | |
def aes128_cbc_encrypt(key, data, iv) | |
key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize) | |
iv = Digest::MD5.digest(iv) if(iv.kind_of?(String) && 16 != iv.bytesize) | |
aes = OpenSSL::Cipher.new('AES-128-CBC') | |
aes.encrypt | |
aes.key = key | |
aes.iv = iv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# This will download files or set the hosts file to defaults. | |
# USAGE: | |
# DESCRIPTION OF ENV VARS HERE | |
############################################################################### | |
set -e # exit on command errors (so you MUST handle exit codes properly!) | |
set -o pipefail # capture fail exit codes in piped commands | |
#set -x # execution tracing debug messages | |
# get switches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'mongoid' | |
require 'json' | |
require "sinatra/reloader" if development? | |
Mongoid.load!("mongoid.yml") | |
class Price | |
include Mongoid::Document |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertTimestamp(timestamp) { | |
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds | |
yyyy = d.getFullYear(), | |
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0. | |
dd = ('0' + d.getDate()).slice(-2), // Add leading 0. | |
hh = d.getHours(), | |
h = hh, | |
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0. | |
ampm = 'AM', | |
time; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'slack-ruby-client' # You will need to install the slack-ruby-client gem | |
require 'faye/websocket' # you will need to install the faye-websocket gem | |
require 'midi-smtp-server' # you will need to install the midi-smtp-server gem | |
require 'mail' # you will need to install the mail gem | |
class TestRailInterceptor < MidiSmtpServer::Smtpd | |
Slack.configure do |config| | |
config.token = ENV['SLACK_API_TOKEN'] # this in an environment variable and add in your Slack Api token for the bot desired | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function 7zundo() { | |
7z l $1 | awk ' {print $6} ' | awk ' | |
function basename(file) { | |
sub(".*/", "", file) | |
return file | |
} | |
{print basename($1)} ' | xargs rm -rf | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jenkins: | |
user.present: | |
- fullname: Jenkins | |
- shell: /bin/bash | |
- home: /home/jenkins | |
/home/jenkins/.bashrc: | |
file.managed: | |
- source: salt://defconf/bash_related/bashrc_base.conf | |
- mode: 644 | |
- user: jenkins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MySql.Data.MySqlClient; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using MySql.Data.MySqlClient; namespace str { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MySql.Data.MySqlClient.MySqlConnection connect; string MyconnetString; MyconnetString = "server=" + textBox1.Text + ";port=" + textBox2.Text + ";Database=" + textBox3.Text + ";uid=" + textBox4.Text + ";pwd=" + textBox5.Text +"; "; try { connect = new MySql.Data.MySqlClient.MySqlConnection(); connect.ConnectionString = MyconnetString; connect.Open(); if (connect .State == ConnectionState.Open ) { button1.ForeColor = Color.Green; MessageBox.Show("Good"); } connect.Close(); // Thank all ): } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show(ex.Message ); } } } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
root /var/www/html; | |
index index.php index.html index.htm index.nginx-debian.html; | |
server_name server_domain_or_IP; | |
include /etc/nginx/additional_conf.d/header_options.conf; |
OlderNewer