Skip to content

Instantly share code, notes, and snippets.

View rrajendran's full-sized avatar

Ramesh Rajendran rrajendran

  • Capella Technologies Ltd.,
  • Wokingham, United Kingdom
View GitHub Profile
@rrajendran
rrajendran / github-repo-private
Last active January 8, 2019 11:35
Python script to make all repos in the github private
from github import Github
# or using an access token
g = Github("<token>")
# Then play with your Github objects:
for repo in g.get_user().get_repos():
repo_details = g.get_repo(repo.id)
if not repo_details.fork:
repo_details.edit(private=True)
@rrajendran
rrajendran / tomcat
Created April 14, 2016 08:12
Service script for tomcat
#!/bin/bash
# This is the init script for starting up the
# Jakarta Tomcat server
#
# chkconfig: 345 91 10
# description: Starts and stops the Tomcat daemon.
#
# Source function library.
. /etc/rc.d/init.d/functions
@rrajendran
rrajendran / WSLoggingInInterceptor
Created May 5, 2014 22:04
Custom LoggingInInterceptor
import java.io.InputStream;
import java.sql.Timestamp;
import javax.servlet.http.HttpServletRequest;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.io.CachedOutputStream;
org.ops4j.pax.url.mvn.repositories= \
http://repo1.maven.org/maven2, \
http://repo.fusesource.com/nexus/content/repositories/releases, \
http://repo.fusesource.com/nexus/content/groups/ea, \
http://repository.springsource.com/maven/bundles/release, \
http://repository.springsource.com/maven/bundles/external, \
http://scala-tools.org/repo-releases default
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.cert.CertificateException;
@rrajendran
rrajendran / gist:8556604
Created January 22, 2014 10:33
Delete all *.orig files in mercurial repository
alias clear-orig='find . -iname "*.orig" -exec rm "{}" ";"'
$$
CREATE PROCEDURE simpleproc (OUT param1 INT)
BEGIN
SELECT COUNT(*) INTO param1 FROM t;
END
$$
<jdbc:initialize-database data-source="dataSource" >
<jdbc:script execution="INIT" separator="//" location="classpath:/scripts/StoredProcedures/*.sql"/>
</jdbc:initialize-database>
delimiter //
CREATE PROCEDURE simpleproc (OUT param1 INT)
BEGIN
SELECT COUNT(*) INTO param1 FROM t;
END//
delimiter ;
@rrajendran
rrajendran / blueprint.xml
Last active March 20, 2021 01:22
Spring osgi service exported and imported by Blueprint. Basically if you want to share spring services with blueprint, this is the work around which worked from me.
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<reference id="helloBean" interface="com.osgi.HelloWorldInterface"/>
<bean id="sageMasterStockService" class="com.osgi.blueprint.impl.HelloWorldService">
<property name="helloBean" ref="helloBean"/>