Skip to content

Instantly share code, notes, and snippets.

View axilleas's full-sized avatar
🏠
Working from home

Achilleas Pipinellis axilleas

🏠
Working from home
View GitHub Profile
@axilleas
axilleas / db
Last active August 29, 2015 14:07 — forked from maellak-test/db
In file C:\xampp\htdocs\openeclass\install\install_db.php on line 684
Error: Unable to execute statement with error: "You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to
use near ' `attempt_status` tinyint(4) NOT NULL DEFAULT 1, ' at line 9" (SQLSTATE=1064 ERROR=42000)
[Statement='CREATE TABLE IF NOT EXISTS `exercise_user_record` ( `eurid` INT(11) NOT NULL AUTO_INCREMENT
PRIMARY KEY, `eid` INT(11) NOT NULL DEFAULT 0, `uid` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
`record_start_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `record_end_date` DATETIME DEFAULT NULL,
`total_score` INT(11) NOT NULL DEFAULT 0, `total_weighting` INT(11) DEFAULT 0, `attempt` INT(11) NOT NULL DEFAULT 0),
`attempt_status` tinyint(4) NOT NULL DEFAULT 1, `secs_remaining` INT(11) NOT NULL DEFAULT '0')
DEFAULT CHARACTER SET=utf8' Elapsed=0.00097599999999998]
@axilleas
axilleas / appearances_helper.rb
Last active June 29, 2016 18:29
GitLab helper for custom login page
# Find this file in app/helpers/appearances_helper.rb
# Discussion at http://axilleas.me/en/blog/2014/custom-gitlab-login-page/
module AppearancesHelper
def brand_item
true
end
def brand_title
'My Organization'
end
@axilleas
axilleas / perm.rb
Last active February 5, 2022 10:42
Permutations of a string
#!/usr/bin/env ruby
# Recursive method, print all strings permutations with length = str.length.
# Iterrate over each character of given string and recursively call
# string_permutations. Each time, a letter from str is stripped and added to elmt.
# When str.length reaches zero, print elmt.
def string_permutations(str, elmt='')
if str.length == 0
p [elmt]
else
@axilleas
axilleas / openshift_rails.md
Created August 2, 2014 17:04
Notes on Redhat's OpenShift with Ruby on Rails

Example

https://github.com/openshift/rails4-example

Tips

  1. NOTE: To disable assets compilation use disable_asset_compilation marker.
  2. NOTE: You can prevent installing certain Gemfile group using: rhc env set BUNDLE_WITHOUT=groupname
  3. NOTE: You can commit .openshift/markers/force_clean_build to force a clean bundle. Just touch the file.
@axilleas
axilleas / git.sh
Created June 5, 2014 17:18
Install gti script
#!/usr/bin/env bash
wget -O /etc/yum.repos.d/PUIAS_6_computational.repo https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/install/centos/PUIAS_6_computational.repo
wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-puias http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias
yum-config-manager --enable PUIAS_6_computational
yum -y update
git --version
require "rubygems"
require "json"
require "net/http"
require "uri"
uri = URI.parse("http://api.sejmometr.pl/posiedzenia/BZfWZ/projekty")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
@axilleas
axilleas / jail.pl
Created December 7, 2013 19:26 — forked from wilbowma/jail.pl
#a/usr/bin/perl
# This script was hastily cobbled together for my own use. It can
# probably break your system. Use at your own risk.
$JAIL = "/srv/http";
$USER = "http";
$GROUP = "http";
$WWW_DIR = "www";
sub run{
@axilleas
axilleas / output
Created November 9, 2013 18:46
igitlab
Cloning into 'gitlab-shell'...
remote: Counting objects: 904, done.
remote: Compressing objects: 100% (555/555), done.
remote: Total 904 (delta 454), reused 742 (delta 314)
Receiving objects: 100% (904/904), 145.26 KiB | 151.00 KiB/s, done.
Resolving deltas: 100% (454/454), done.
Checking connectivity... done
error: unknown switch `s'
usage: git checkout [options] <branch>
or: git checkout [options] [<branch>] -- <file>...
@axilleas
axilleas / journal.log
Created September 17, 2013 16:46
journal log
-- Logs begin at Thu 2013-08-01 10:34:18 EEST, end at Tue 2013-09-17 18:35:14 EEST. --
Sep 17 18:33:45 thedude systemd-journal[95]: Runtime journal is using 344.0K (max 94.6M, leaving 141.9M of free 946.1M, current limit 94.6M).
Sep 17 18:33:45 thedude systemd-journal[95]: Runtime journal is using 348.0K (max 94.6M, leaving 141.9M of free 946.1M, current limit 94.6M).
Sep 17 18:33:45 thedude kernel: Initializing cgroup subsys cpuset
Sep 17 18:33:45 thedude kernel: Initializing cgroup subsys cpu
Sep 17 18:33:45 thedude kernel: Initializing cgroup subsys cpuacct
Sep 17 18:33:45 thedude kernel: Linux version 3.11.1-1-ARCH (tobias@testing-i686) (gcc version 4.8.1 20130725 (prerelease) (GCC) ) #1 SMP PREEMPT Sat Sep 14 20:31:35 CEST 2013
Sep 17 18:33:45 thedude kernel: Disabled fast string operations
Sep 17 18:33:45 thedude kernel: e820: BIOS-provided physical RAM map:
Sep 17 18:33:45 thedude kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
@axilleas
axilleas / cpuinfo
Last active December 22, 2015 01:49
/proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 2
model name : QEMU Virtual CPU version 1.1.2
stepping : 3
microcode : 0x1000065
cpu MHz : 2100.040
cache size : 512 KB
fpu : yes