Skip to content

Instantly share code, notes, and snippets.

View rocketraman's full-sized avatar

Raman Gupta rocketraman

View GitHub Profile
@rocketraman
rocketraman / BackupPC_deleteFile.pl
Last active November 8, 2017 22:05
BackupPC_deleteFile.pl
#!/usr/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_deleteFile.pl: Delete one or more files/directories from
# a range of hosts, backups, and shares
#
# DESCRIPTION
# See below for detailed description of what it does and how it works
#
# AUTHOR
package mypackage.web
import akka.actor._
import akka.io.IO
import akka.pattern.{AskTimeoutException, ask, gracefulStop, pipe}
import com.typesafe.scalalogging.slf4j.Logger
import javax.inject.Inject
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
@rocketraman
rocketraman / TestCacheOpen.scala
Last active August 29, 2015 14:01
Spray caching test with no compression
import akka.actor.ActorSystem
import java.io.FileWriter
import scala.Some
import scala.util.{Failure, Success}
import spray.http.HttpEncodings._
import spray.http.HttpHeaders.`Accept-Encoding`
import spray.http.HttpMethods.GET
import spray.http._
import spray.httpx.encoding.{Gzip, Deflate, NoEncoding}
import spray.routing.RequestContext
@rocketraman
rocketraman / gist:9905217
Created April 1, 2014 00:18
Git-based (contrib) prompt
GRN="\[\e[32m\]"
YLW="\[\e[33m\]"
BLU="\[\e[34m\]"
PNK="\[\e[35m\]"
NOc="\[\033[0m\]"
source /usr/share/git-core/contrib/completion/git-prompt.sh
PROMPT_COMMAND='__git_ps1 "$GRN\u@\h $YLW\w$NOc" " $YLW\\\$$NOc "'
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWCOLORHINTS=1
@rocketraman
rocketraman / gist:9586639
Created March 16, 2014 17:18
Xorg.0.log second start (good)
[ 196.211]
X.Org X Server 1.14.4
Release Date: 2013-10-31
[ 196.211] X Protocol Version 11, Revision 0
[ 196.211] Build Operating System: 3.12.8-300.fc20.x86_64
[ 196.211] Current Operating System: Linux edison 3.13.6-200.fc20.x86_64 #1 SMP Fri Mar 7 17:02:28 UTC 2014 x86_64
[ 196.211] Kernel command line: BOOT_IMAGE=/vmlinuz-3.13.6-200.fc20.x86_64 root=/dev/mapper/vg_ssd-lv_root ro root=/dev/mapper/vg_ssd-lv_root ro quiet rhgb SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us
[ 196.211] Build Date: 28 February 2014 03:35:50AM
[ 196.211] Build ID: xorg-x11-server 1.14.4-7.fc20
[ 196.211] Current version of pixman: 0.30.0
@rocketraman
rocketraman / gist:9586629
Created March 16, 2014 17:17
Xorg.0.log corrupted display
[ 33.270]
X.Org X Server 1.14.4
Release Date: 2013-10-31
[ 33.270] X Protocol Version 11, Revision 0
[ 33.270] Build Operating System: 3.12.8-300.fc20.x86_64
[ 33.270] Current Operating System: Linux edison 3.13.6-200.fc20.x86_64 #1 SMP Fri Mar 7 17:02:28 UTC 2014 x86_64
[ 33.270] Kernel command line: BOOT_IMAGE=/vmlinuz-3.13.6-200.fc20.x86_64 root=/dev/mapper/vg_ssd-lv_root ro root=/dev/mapper/vg_ssd-lv_root ro quiet rhgb SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us
[ 33.270] Build Date: 28 February 2014 03:35:50AM
[ 33.270] Build ID: xorg-x11-server 1.14.4-7.fc20
[ 33.270] Current version of pixman: 0.30.0
@rocketraman
rocketraman / gist:9586599
Created March 16, 2014 17:14
Xorg.0.log (diff)
--- /dev/fd/63 2014-03-16 13:14:14.831590777 -0400
+++ /dev/fd/62 2014-03-16 13:14:14.831590777 -0400
@@ -13,7 +13,7 @@
Markers: (--) probed, (**) from config file, (==) default setting,
ommand line, (!!) notice, (II) informational,
g, (EE) error, (NI) not implemented, (??) unknown.
- (==) Log file: "/var/log/Xorg.0.log", Time: Sun Mar 16 12:41:44 2014
+ (==) Log file: "/var/log/Xorg.0.log", Time: Sun Mar 16 12:44:27 2014
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
@rocketraman
rocketraman / TestSsl.java
Last active July 19, 2016 18:07
Quick and dirty SSL test code
import javax.net.SocketFactory;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.net.Socket;
import java.security.KeyStore;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
public class TestSsl {
import akka.actor._
import akka.japi.Creator
import java.util.UUID
import ActorFactory.genName
import org.slf4j.Logger
/**
* A base class for all ActorFactory implementations. An ActorFactory can be used to create a new Actor within
* the Akka execution context at runtime, but provides the ability to inject dependencies from Spring into the Actor.
*/
@rocketraman
rocketraman / colorize-maven.sh
Created September 21, 2012 00:19 — forked from mike-ensor/colorize-maven.sh
Colorize Maven output
#!/bin/sh
# Written by Mike Ensor ([email protected])
# Copywrite 2012
# Use as needed, modify, have fun!
# This is intended to be used for Maven3 + Mac OSX
#
# Modified by Raman Gupta ([email protected])
# - proper escaping of sed capture groups (needed for Linux?)
# - tabs replaced with four spaces for consistency across editors