diff --git a/CSharp/Hangover.cs b/CSharp/Hangover.cs new file mode 100644 index 0000000..fe7a588 --- /dev/null +++ b/CSharp/Hangover.cs @@ -0,0 +1,34 @@ +namespace Hacker_Scripts +{ + using System; + using Twilio; + using System.Linq; + + class Hangover + { + public static string TWILIO_ACCOUNT_SID = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID"); + public static string AUTH_TOKEN = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN"); + + public static string YOUR_NUMBER = "9879789978"; + public static string BOSS_NUMBER = "3213213233"; + + static void Main(string[] args) + { + var twilio = new TwilioRestClient(TWILIO_ACCOUNT_SID, AUTH_TOKEN); + + string[] randomMessages = { + "Locked out", + "Pipes broke", + "Food poisoning", + "Not feeling well" + }; + + int randomIndex = new Random().Next(randomMessages.Count()); + String messageToSend = (randomMessages[randomIndex]); + + var message = twilio.SendMessage(YOUR_NUMBER, BOSS_NUMBER, messageToSend); + Console.WriteLine(message.Sid); + } + } +} + diff --git a/CSharp/SmackMyBitch.cs b/CSharp/SmackMyBitch.cs new file mode 100644 index 0000000..d5c13fc --- /dev/null +++ b/CSharp/SmackMyBitch.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Twilio; + +namespace Hacker_Scripts +{ + class SmackMyBitch + { + public static string TWILIO_ACCOUNT_SID = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID"); + public static string AUTH_TOKEN = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN"); + + public static string YOUR_NUMBER = "9879789978"; + public static string HER_NUMBER = "3213213233"; + + static void Main(string[] args) + { + var twilio = new TwilioRestClient(TWILIO_ACCOUNT_SID, AUTH_TOKEN); + + string[] randomMessages = { + "Working hard", + "Gotta ship this feature", + "Someone fucked the system again" + }; + + int randomIndex = new Random().Next(randomMessages.Count()); + String messageToSend = (randomMessages[randomIndex]); + + var message = twilio.SendMessage(YOUR_NUMBER, HER_NUMBER, messageToSend); + Console.WriteLine(message.Sid); + } + } +} diff --git a/go/smack_my_bitch_up.go b/go/smack_my_bitch_up.go index 7e7fb7a..4196688 100755 --- a/go/smack_my_bitch_up.go +++ b/go/smack_my_bitch_up.go @@ -1,39 +1,38 @@ package main -import( - "os/exec" - "fmt" - "strings" - "os" - "math/rand" - "time" - ) +import ( + "fmt" + "math/rand" + "os" + "os/exec" + "strings" + "time" +) -func main(){ - output1,err := exec.Command("who").Output() - output2 := os.Getenv("USER") - users := string(output1[:]) - current_user := string(output2[:]) - if(!strings.Contains(users,current_user)){ - return - } +func main() { + output1, err := exec.Command("who").Output() + output2 := os.Getenv("USER") + users := string(output1[:]) + current_user := string(output2[:]) + if !strings.Contains(users, current_user) { + return + } + reasons := []string{"Working hard", "Gotta ship this feature", "Someone fucked the system again"} - reasons := []string {"Working hard","Gotta ship this feature","Someone fucked the system again"} + rand.Seed(time.Now().UTC().UnixNano()) + message := "Late at work. " + reasons[rand.Intn(len(reasons))] - rand.Seed(time.Now().UTC().UnixNano()) - message := "Late at work. " + reasons[rand.Intn(len(reasons))] + TWILIO_ACCOUNT_SID := string(os.Getenv("TWILIO_ACCOUNT_SID")) + TWILIO_AUTH_TOKEN := string(os.Getenv("TWILIO_AUTH_TOKEN")) + MY_NUMBER := string(os.Getenv("MY_NUMBER")) + HER_NUMBER := string(os.Getenv("HER_NUMBER")) - TWILIO_ACCOUNT_SID := string(os.Getenv("TWILIO_ACCOUNT_SID")) - TWILIO_AUTH_TOKEN := string(os.Getenv("TWILIO_AUTH_TOKEN")) - MY_NUMBER := string(os.Getenv("MY_NUMBER")) - HER_NUMBER := string(os.Getenv("HER_NUMBER")) + response, err := exec.Command("curl", "-fSs", "-u", TWILIO_ACCOUNT_SID+":"+TWILIO_AUTH_TOKEN, "-d", "From="+MY_NUMBER, "-d", "To="+HER_NUMBER, "-d", "Body="+message, "https://api.twilio.com/2010-04-01/Accounts/"+TWILIO_ACCOUNT_SID+"/Messages").Output() + if err != nil { + fmt.Printf("Failed to send SMS: %s", err) + return + } - response,err := exec.Command("curl","-fSs","-u",TWILIO_ACCOUNT_SID + ":" + TWILIO_AUTH_TOKEN, "-d", "From=" + MY_NUMBER, "-d", "To=" + HER_NUMBER, "-d" , "Body=" + message, "https://api.twilio.com/2010-04-01/Accounts/" + TWILIO_ACCOUNT_SID + "/Messages").Output() - if(err != nil){ - fmt.Printf("Failed to send SMS: %s",err) - return - } - - fmt.Printf("Message Sent Successfully with response: %s ",response) + fmt.Printf("Message Sent Successfully with response: %s ", response) } diff --git a/powershell/fucking_coffee.psm1 b/powershell/fucking_coffee.psm1 index 55b1289..980eb62 100644 --- a/powershell/fucking_coffee.psm1 +++ b/powershell/fucking_coffee.psm1 @@ -1,7 +1,7 @@ <# .SYNOPSIS Simple script to connect to a coffee part using TelNet then issue specific commands that - brew and pourt a cup of coffee for the user. + brew and pour a cup of coffee for the user. .DESCRIPTION This script was converted using the ruby version of the fucking_coffee script. In this script, I left the use of environment variables since its only use was to determine if the user was @@ -59,4 +59,4 @@ Function Send-TelNetCommands $writer.WriteLine($command) $writer.Flush() Start-Sleep -Milliseconds $WaitTime -} \ No newline at end of file +}