Skip to content

Instantly share code, notes, and snippets.

View Morgaroth's full-sized avatar

MatJ Morgaroth

  • Kraków, Poland
View GitHub Profile
#!/bin/bash
if [ "$1" == "--help" ]
then
echo "args: jar policy codebase adres port hostname nick [start|join oponent] [auto]"
else
jar=$1
policy=`readlink -f $2`
//wyslanie kodu na studenta
scp ./checkers-server/target/checkers-server-1.0-SNAPSHOT.jar mjaje@student.agh.edu.pl:~/public_html/checkers-server-classes.jar

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@Morgaroth
Morgaroth / compileidl.sh
Created May 4, 2014 21:26
compileidl on unix
#!/bin/sh
if [ "$1" == "--help" ] || [ "$1" == "-h" ]
then
echo "run this script in project root dir"
fi
idlj -fall -td ./generated -pkgTranslate example1 edu.sr.generated.example1 ./idl/sr.idl
@Morgaroth
Morgaroth / generate_imgs.sh
Created December 6, 2014 11:44
skrypt generujacy obrazki dobreg rozmiaru do apki androida
#!/bin/bash
filename=$1
if [ "$filename" == "" ];then
echo No file typed
else
mdpi_size="-resize 48X48"
hdpi_size="-resize 72X72"
xhdpi_size="-resize 96X96"
xxhdpi_size="-resize 144X144"
@Morgaroth
Morgaroth / Procfile
Last active August 29, 2015 14:16
spray heroku
web: target/start -Dhttp.port=$PORT $JAVA_OPTS
@Morgaroth
Morgaroth / App.scala
Last active October 8, 2015 21:35
TPR generator wykresów
package io.github.morgaroth.studia.semVII.tpr.lab1
import java.io.{File, FilenameFilter}
import scala.io.Source
object App {
def loadFilesWithPrefix(par: File, prefix: String): List[File] = {
@Morgaroth
Morgaroth / build.sbt
Created September 21, 2015 17:55
multi jars in assembly task sbt assembly
val Server = config("server") extend Compile
inConfig(Server)(
baseAssemblySettings ++
inTask(assembly)(mainClass := Some("io.github.morgaroth.telegram.bot.test.WebServer")) ++
inTask(assembly)(assemblyJarName := s"test-bots-server-" + version.value + ".jar")
)
val Standalone = config("standalone") extend Compile
@Morgaroth
Morgaroth / mongo_db1.pro
Last active October 8, 2015 21:57
keep proguard from removing implicit conversions to scala from file com.mongodb.casbah.Implicits (done by reflection calls)
# java.lang.NoSuchMethodException: b.a.a.g$b.asScala()
# thrown from com.mongodb.casbah.Implicits implicit conversions
-keepclassmembers class com.mongodb.casbah.Implicits$$anon$4 {
com.mongodb.casbah.MongoCollection asScala();
}
-keepclassmembers class com.mongodb.casbah.Implicits$$anon$5 {
com.mongodb.casbah.MongoDB asScala();
}
@Morgaroth
Morgaroth / mongodb casbah proguard.pro
Created October 8, 2015 22:28
preventing proguard inlining MBean interface, mongo db casbah
# javax.management.NotCompliantMBeanException: MBean class com.mongodb.ConnectionPoolStatistics does not implement
# DynamicMBean, and neither follows the Standard MBean conventions (javax.management.NotCompliantMBeanException:
# Class com.mongodb.ConnectionPoolStatistics is not a JMX compliant Standard MBean) nor the MXBean
# conventions (javax.management.NotCompliantMBeanException: com.mongodb.ConnectionPoolStatistics: Class
# com.mongodb.ConnectionPoolStatistics is not a JMX compliant MXBean)
# Then probably You have enabled optimizations and interface com.mongodb.ConnectionPoolStatisticsMBean is inlined into class
# com.mongodb.ConnectionPoolStatistics, so to prevent errors simply keep this interface and implementing class with all fields
-keep interface com.mongodb.ConnectionPoolStatisticsMBean