Skip to content

Instantly share code, notes, and snippets.

Janos Gyerik janosgyerik

Block or report user

Report or block janosgyerik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@janosgyerik
janosgyerik / ssh-connection-multiplexing
Created Apr 29, 2012
Enable ssh connection multiplexing
View ssh-connection-multiplexing
# ~/.ssh/config
#
Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
@janosgyerik
janosgyerik / ssh-agent-setup
Created Apr 29, 2012
Setup ssh agent automatically on login
View ssh-agent-setup
# ssh agent setup
SSH_ENV=$HOME/.ssh/env
start_ssh_agent() {
ssh-agent > $SSH_ENV
. $SSH_ENV
}
check_ssh_agent() {
@janosgyerik
janosgyerik / crc.c
Created May 3, 2012
crc implementation in c++
View crc.c
#include <stdio.h>
#include <stdint.h>
#include <string.h>
void crc8PushByte(uint8_t *crc, uint8_t ch) {
uint8_t i;
*crc = *crc ^ ch;
for (i=0; i<8; i++) {
@janosgyerik
janosgyerik / dot.gitconfig
Created May 14, 2012
My typical .gitconfig
View dot.gitconfig
[user]
name = Janos Gyerik
email = janos@example.com
[alias]
st = status
ci = commit
br = branch
co = checkout
ls = ls-files
View Increase-JVM-heap-size.txt
java -Xms64m -Xmx256m -XX:MaxPermSize=128m HelloWorld
@janosgyerik
janosgyerik / log4j.properties
Created May 29, 2012
A very basic log4j.properties example
View log4j.properties
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} - %-5p %c{1} - %m%n
# 2012-05-18 15:58:39,210 - DEBUG CLASSNAME_WITHOUT_DOMAIN - LOGMESSAGE
@janosgyerik
janosgyerik / dump-foursquare-categories.py
Created Jun 10, 2012
Dump foursquare categories to a file in JSON format
View dump-foursquare-categories.py
#!/usr/bin/env python
#
# Notes:
#
# - python API home:
# https://github.com/mLewisLogic/foursquare
#
# - foursquare API home:
# https://developer.foursquare.com/
#
@janosgyerik
janosgyerik / passenger_wsgi.py
Last active Oct 8, 2015
passenger_wsgi.py for a django site
View passenger_wsgi.py
projectname = 'bashoneliners'
virtualenv_root = '/path/to/virtualenv/' + projectname
import sys
import os
INTERP = os.path.join(virtualenv_root, 'bin', 'python')
if sys.executable != INTERP:
os.execl(INTERP, INTERP, *sys.argv)
View list-partitioner-test.md

  • Write a partition method that takes a list and size parameters and returns a list of sublists, where each sublist has at most size elements.

    Example inputs and outputs:

    • Example 1: partition([1,2,3,4,5], 2) returns: [ [1,2], [3,4], [5] ]
    • Example 2: partition([1,2,3,4,5], 3) returns: [ [1,2,3], [4,5] ]
    • Example 3: partition([1,2,3,4,5], 1) returns: [ [1], [2], [3], [4], [5] ]
View eclipse.ini
-showlocation
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttp.proxyPort=8080
-Dhttp.proxyHost=the_ip_address
-Dhttp.proxyUser=the_username
#-Dhttp.proxyPassword=only_enter_temporarily_when_needed_and_remove_after
-Xms512m
-Xmx912m
You can’t perform that action at this time.