Skip to content

Instantly share code, notes, and snippets.

@lifuzu
lifuzu / tomcat.sh
Created September 25, 2013 16:53 — forked from valotas/tomcat.sh
#!/bin/bash
#
# tomcat7 This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
@lifuzu
lifuzu / my.cnf
Created September 25, 2013 17:17
MYSQL replication configuration /etc/mysql/my.cfg
-bind-address = 127.0.0.1
+#bind-address = 127.0.0.1
#
# * Fine Tuning
#
@@ -55,7 +55,7 @@ thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
-#max_connections = 100
@lifuzu
lifuzu / server.R
Created October 4, 2013 18:28
R sample source code - hello R
shinyServer(function(input, output) {
output$main_plot <- renderPlot({
hist(faithful$eruptions,
probability = TRUE,
breaks = as.numeric(input$n_breaks),
xlab = "Duration (minutes)",
@lifuzu
lifuzu / hello_world.script
Created October 4, 2013 20:46
Remove duplicates email from Outlook
tell application "Finder"
display dialog "hello world!"
end tell
@lifuzu
lifuzu / StringXORer.java
Created October 14, 2013 19:48
XOR in Java: Compile it: javac -cp commons-codec-1.8/commons-codec-1.8.jar StringXORer.java Run it: java -cp ".:commons-codec-1.8/commons-codec-1.8.jar" StringXORer
import org.apache.commons.codec.binary.Base64;
public class StringXORer {
public static void main(String[] args) {
StringXORer x = new StringXORer();
String a="hello";
String b="world";
System.out.println(a);
@lifuzu
lifuzu / XOR.cpp
Created October 14, 2013 22:03
XOR in C++
#include <iostream>
#include <bitset>
static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s);
android {
defaultConfig {
versionName "actionbar"
}
signingConfigs {
release {
storeFile file("android.keystore")
...
}
}
@lifuzu
lifuzu / .gitignore
Created December 10, 2013 02:26
gitignore
# Eclipse
.classpath
.project
.settings/
.metadata
# Intellij
.idea/
*.iml
*.iws
@lifuzu
lifuzu / build.gradle
Created December 12, 2013 00:36
Upload of file via SSH protocol
//Upload of file via SSH
//build.gradle
configurations {
deployerJars
}
repositories {
mavenCentral()
@lifuzu
lifuzu / build.gradle
Created December 12, 2013 01:03
Generation of multiple poms, upload multiple artifacts at one time.
//Generation of multiple poms
//build.gradle
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://localhost/tmp/myRepo/")
addFilter('api') {artifact, file ->
artifact.name == 'api'