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 'aws' | |
class S3FolderUpload | |
attr_reader :folder_path, :total_files, :s3_bucket | |
attr_accessor :files | |
# Initialize the upload class | |
# | |
# folder_path - path to the folder that you want to upload | |
# bucket - The bucket you want to upload to |
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 | |
region=us-west-2 | |
ami=ami-927613a2 | |
# http://cloud-images.ubuntu.com/locator/ec2/ | |
echo "Input server name: " | |
read server_name | |
USERDATA=$(cat <<-EOF |
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
$ModLoad imfile # Load the imfile input module | |
# <syslog-tag> Tag you give to syslog in order to identigy the input coming from this file eg: nginx-access/rails/some_other_name | |
# <statefile-name> What do you want the state file to be called eg: nginx-access-state | |
# use @@ if you want to send logs over TCP | |
# use @ if you want to send logs over UDP | |
$InputFileName /path/to_log_location.log | |
$InputFileTag <syslog-tag>: | |
$InputFileStateFile <statefile-name> |
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
diff -ur orig/ext/readline/readline.c fixed/ext/readline/readline.c | |
--- orig/ext/readline/readline.c 2014-03-18 13:53:31.866359527 +0100 | |
+++ fixed/ext/readline/readline.c 2014-03-18 13:56:26.390247250 +0100 | |
@@ -1883,7 +1883,7 @@ | |
rl_attempted_completion_function = readline_attempted_completion_function; | |
#if defined(HAVE_RL_PRE_INPUT_HOOK) | |
- rl_pre_input_hook = (Function *)readline_pre_input_hook; | |
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook; | |
#endif |
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
ec2-describe-instances | grep running | awk '{print $9}' |
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 EXISTS(select * from sysobjects where id = object_id('dbo.SP_ShrinkAllDatabasesOnServer') and xtype = 'P') | |
DROP PROCEDURE dbo.SP_ShrinkAllDatabasesOnServer | |
GO | |
CREATE PROCEDURE dbo.SP_ShrinkAllDatabasesOnServer | |
AS | |
BEGIN | |
CREATE TABLE #TempDatabasesTable | |
( | |
[DatabaseName] sysname not null primary key, |
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
DECLARE @DatabaseName varchar(100), @SqlStatement varchar(1024) | |
SET ROWCOUNT 1 | |
SELECT @DatabaseName = NAME FROM SYSDATABASES ORDER BY NAME | |
WHILE @@ROWCOUNT > 0 | |
BEGIN | |
SET @SqlStatement = 'ALTER TABLE tblUsers ALTER COLUMN email nvarchar(250) NOT NULL' | |
SELECT @SqlStatement = 'Use [' + @DatabaseName + '] exec (' + @SqlStatement + ')' | |
PRINT (@SqlStatement) | |
SELECT @DatabaseName = NAME FROM SYSDATABASES WHERE NAME > @DatabaseName |
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
DECLARE @DatabaseName varchar(100), @SqlStatement varchar(1024) | |
SET ROWCOUNT 1 | |
SELECT @DatabaseName = NAME FROM SYSDATABASES ORDER BY NAME | |
WHILE @@ROWCOUNT > 0 | |
BEGIN | |
-- Change this to your own SQL statement you want to execute against your db's | |
SET @SqlStatement = 'ALTER TABLE tblUsers ALTER COLUMN email nvarchar(250) NOT NULL' | |
SELECT @SqlStatement = 'Use [' + @DatabaseName + '] exec (' + @SqlStatement + ')' | |
-- Print the command to the screen |
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
/// <summary> | |
/// credit card number and an attached weight number | |
/// </summary> | |
public class CreditCardNumbers | |
{ | |
public int number { get; set; } | |
public int weightNumber { get; set; } | |
/// <summary> | |
/// Initializes a new instance of the <see cref="CreditCardNumbers"/> class. |
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
/// <summary> | |
/// Determines whether [is odd number] [the specified number]. | |
/// </summary> | |
/// <param name="number">The number.</param> | |
/// <returns> | |
/// <c>true</c> if [is odd number] [the specified number]; otherwise, <c>false</c>. | |
/// </returns> | |
public static bool isOddNumber(int number) | |
{ | |
if (number % 2 == 0) |
OlderNewer