This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Must be a valid filename | |
NAME=apache-solr | |
VERSION=4.0.0-ALPHA | |
APPNAME=joko | |
APPDIR=/home/jacob/$NAME-$VERSION/$APPNAME | |
#/var/run/app must be writable by your user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Must be a valid filename | |
NAME=apache-solr | |
VERSION=4.0.0-ALPHA | |
APPNAME=joko | |
APPDIR=/home/joinus/$NAME-$VERSION/$APPNAME | |
PIDFILE=/var/run/solr.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mongo admin --quiet mtr.js | |
var username = ''; | |
var password = ''; | |
var dbname = ''; | |
db.auth(username, password); | |
db = db.getSiblingDB(dbname); | |
db.getCollectionNames().forEach(function(collection) { | |
count = db[collection].count(); | |
if (collection === "Phashes") { | |
if (count < 1000000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# The MIT License | |
# | |
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MOVE | |
MOVE | |
MOVE | |
RIGHT | |
MOVE | |
REPORT | |
RIGHT | |
MOVE | |
RIGHT | |
MOVE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def http_client(url, method, headers={}, body=nil) | |
require 'net/http' | |
uri = URI.parse("#{url}") | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true if uri.scheme == "https" | |
request = "Net::HTTP::#{method.capitalize}".constantize.new(uri.request_uri) | |
headers.keys.each do |key| | |
request[key] = headers[key] | |
end | |
if body.is_a?(Hash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List.fill(9)(1 to 9).zipWithIndex.map{ case(v, i) => v.map(a => f"$a%02d * ${i+1}%02d = ${a*(i+1)}%02d") }.flatten.map(println) | |
(1 to 9).flatMap( x => (1 to 9).map( (x, _) )).map(x => f"${x._1}%02d * ${x._2}%02d = ${x._1 * x._2}%02d").foreach(println) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options: | |
-c, --connection-limit=N connection limit for role (default: no limit) | |
-d, --createdb role can create new databases | |
-D, --no-createdb role cannot create databases (default) | |
-e, --echo show the commands being sent to the server | |
-E, --encrypted encrypt stored password | |
-i, --inherit role inherits privileges of roles it is a | |
member of (default) | |
-I, --no-inherit role does not inherit privileges |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
a = [random.randint(1,100) for _ in range(20)] | |
sorted_array = [] | |
def swap(a, ppos, cpos): | |
a[ppos],a[cpos] = a[cpos],a[ppos] | |
print(a[ppos], a[cpos], ppos, cpos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kdn.evcs.service; | |
import Kisinfo.Check.IPINClient; | |
import NiceID.Check.CPClient; | |
import com.kdn.evcs.common.BaseConstant; | |
import com.kdn.evcs.common.LogHelper; | |
import org.springframework.stereotype.Service; | |
import java.util.HashMap; | |
import java.util.Map; |
OlderNewer