Skip to content

Instantly share code, notes, and snippets.

View alkavan's full-sized avatar
🌴

Igal Alkon alkavan

🌴
View GitHub Profile
@alkavan
alkavan / rocky-linux-9_web-application-server.md
Last active June 8, 2024 19:51
Rocky Linux 9 | Web Application Server

Rocky Linux 9 | Web Application Server Installation

Notice

This cheatsheet assumes the user is knowledgeable about bare installations of virtual private servers on cloud providers and is looking for quick but comprehensive instructions.

Some trivial commands might be missed or skipped.
However, this document can also work as quick tutorial for newcomers to the RHEL eco-system.

Initial System Setup

@alkavan
alkavan / ctf.cfg
Last active April 8, 2023 07:37
Install IOQUAKE3 on Rocky Linux 9.0
set sv_hostname "BewareSpace Q3 Arena (CTF)"
set sv_maxclients 12
set g_motd "mess with the best, die like the rest."
set g_forcerespawn 10
set g_gametype 4
set bot_minplayers 8
set g_spskill 3
set timelimit 15
set m1 "capturelimit 8; map q3ctf1 ; set nextmap vstr m2"
@justecorruptio
justecorruptio / 2048.c
Created April 4, 2014 03:49
Tiny 2048 in C!
M[16],X=16,W,k;main(){T(system("stty cbreak")
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<<
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k)
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X]
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4;
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4||
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2
@rafi
rafi / INSTALL.md
Last active December 30, 2015 20:19
My Arch Linux installation
@r-lyeh-archived
r-lyeh-archived / compo.cpp
Last active December 9, 2019 06:28
Component-entity system in 16 lines of C++11. extract from kult engine (https://github.com/r-lyeh/kult)
#include <map> // Component-entity system in 16 lines of C++11. 2013 rlyeh, MIT licensed
#include <set> // Code fragment from kult engine - https://github.com/r-lyeh/kult
enum {JOIN,MERGE,EXCLUDE};using set=std::set<unsigned>;template<typename T> set&system(){
static set entities;return entities;}template<typename T,int MODE>set subsystem(const set
&B){set newset;const set&A=system<T>();if(MODE==MERGE){newset=B;for(auto&id:A)newset.ins\
ert(id);}else if(MODE==EXCLUDE){newset=B;for(auto&id:A)newset.erase(id);}else if(A.size()
<B.size()){for(auto&id:A)if(B.find(id)!=B.end())newset.insert(id);}else{for(auto&id:B)if(
A.find(id)!=A.end())newset.insert(id);}return newset;}template<typename T>std::map<unsig\
ned,T>&components(){static std::map<unsigned,T>objects;return objects;}template<typename\
T>bool has(unsigned id){return components<T>().find(id)!=components<T>().end();}templat\
@r-lyeh-archived
r-lyeh-archived / grid.hpp
Last active December 14, 2015 22:48
A 2D/3D collision grid
// A 2D/3D collision grid. MIT licensed
// - rlyeh, 2012
#pragma once
#include <map>
#include <set>
#include <cassert>
#include <tuple>
@alkavan
alkavan / Makefile
Created December 7, 2012 18:44
basic makefile for c++ project
# basic makefile for c++ project
SOURCE=main.cpp your_include.h
MYPROGRAM=shellgap
MYINCLUDES=
MYLIBRARIES=
CC=g++
#------------------------------------------------------------------------------
@alkavan
alkavan / set-mouse-to-human-sensitivity.sh
Created November 25, 2012 19:00
script for setting mouse sensitivity to human speed on fedora 17
#!/bin/bash
# if you need to set mouse sensitivity on X or gnome3 to value lower than the
# mouse configuration utility provides, this is the script for you.
# script built for fedora 17, but it should work for some other distros as well.
echo -e "\ncheck the 'id' of you mouse device ...\n"
xinput
echo "---- ---- ---- ----"
@alkavan
alkavan / build-php.sh
Created March 6, 2012 13:28
Compile PHP (on CentOS)
#!/bin/bash
# This is my compile command
# works good for me with PHP 5.3/5.4
# You might need this packages too (CentOS 5/6 tested)
#sudo yum install libxml2-devel.x86_64
#sudo yum install httpd-devel.x86_64
#sudo yum install openssl-devel.x86_64
@alkavan
alkavan / json.php
Created June 12, 2011 19:59
JSON Helper for Kohana v3
<?php defined('SYSPATH') or die('No direct script access.');
/**
* JSON helper class
*
* Examples:
* $j = JSON::decode('{"Organization": "Kohana"}'); // Good
* $j = JSON::decode("{'Organization': 'Kohana'}"); // Invalid
* $j = JSON::decode('{"Organization": "Kohana"}', NULL, 1); // depth stack exceeded
*
* @package Kohana