Skip to content

Instantly share code, notes, and snippets.

View m0k1's full-sized avatar
👻
Hunting bugs like Ghost Buster !

Momčilo Mićanović m0k1

👻
Hunting bugs like Ghost Buster !
View GitHub Profile
@m0k1
m0k1 / main.cpp
Created June 24, 2015 12:36
Test sa-mp functions ingame. (main.cpp)
#include <stdio.h>
#include <string.h>
using namespace std;
bool strEqual(char string[], char toComp[])
{
int len = strlen(toComp);
char oldchar = string[len];
@m0k1
m0k1 / CmdsFS.pwn
Created June 24, 2015 12:37
TestFunctions FilterScript
#include <a_samp>
#define SendFormatMsg(%0,%1) new strformatmsg[512]; format(strformatmsg, 512, %0, %1); SendText(playerid,strformatmsg)
#define SendFormatMsgToAll(%0,%1) new strformatmsg[512]; format(strformatmsg, 512, %0, %1); SendClientMessageToAll(-1,strformatmsg)
#define SendFormatMsgForPlayer(%0,%1,%2) new strformatmsg[512]; format(strformatmsg, 512, %1, %2); SendText(%0,strformatmsg)
#define ifCMD(%0) if(!strcmp(cmd, %0, true))
#define RetMsg(%0) new RetStrMsg[512] = %0
#define GetInt(%0) cmd = GetParameter(cmdtext, idx); if(!strlen(cmd)) return SendText(playerid, RetStrMsg); new %0 = strval(cmd)
#define GetFloat(%0) cmd = GetParameter(cmdtext, idx); if(!strlen(cmd)) return SendText(playerid, RetStrMsg); new Float:%0 = floatstr(cmd)
#define GetText(%0) cmd = GetParameter(cmdtext, idx); if(!strlen(cmd)) return SendText(playerid, RetStrMsg); new Text:%0 = Text:strval(cmd)
@m0k1
m0k1 / ubuntu-php-development-environment.md
Last active August 29, 2015 14:27 — forked from DaRaFF/ubuntu-php-development-environment.md
Ubuntu php development environment

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

@m0k1
m0k1 / vnc_manual.txt
Last active November 10, 2022 04:55
How to install VNC server ubuntu digitalocean
just edit the vnc_user in this text
-------------------------------
apt-get install gnome-core xfce4 firefox
apt-get install vnc4server
adduser vnc_user
su - vnc_user
vncserver
cp ~/.vnc/xstartup ~/.vnc/xstartup.bak
rm -rf ~/.vnc/xstartup
@m0k1
m0k1 / AutoOpenVPN.sh
Last active December 27, 2015 23:08
openvpn_autoconfig and install for Ubuntu 14.04 (digitalocean)
#!/bin/bash
#
# Script to set up OpenVPN for routing all traffic.
# https://github.com/tinfoil/openvpn_autoconfig
#
set -e
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 1>&2
exit 1
@m0k1
m0k1 / SentoraLetsEncrypt.html
Last active February 24, 2016 02:02
Let's Encrypt command generator for Sentora Gist Available on https://gist.githack.com/m0k1/8934345d380a470e3c66/raw/SentoraLetsEncrypt.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script>
<title>LetsEcryptSentora</title>
<script type='text/javascript'>
//<![CDATA[
$(window).load(function()
{
@m0k1
m0k1 / hexosyntax.js
Created July 20, 2016 03:14
Nice hexo/hacker style syntax for your blog post's
document.addEventListener('DOMContentLoaded', function() {
var charcolors = {'a':"red", 'b':"orange", 'c':"cyan", 'd':"yellow", 'e':"blue", 'f':"purple", 'g':"red", 'h':"orange", 'i':"yellow", 'j':"green", 'k':"blue", 'l':"blue", 'm':"red", 'n':"orange", 'o':"yellow", 'p':"green", 'q':"blue", 'r':"purple", 's':"green", 't':"orange", 'u':"yellow", 'v':"green", 'w':"blue", 'x':"purple", 'y':"red", 'z':"orange", '1':"red", '2':"green", '3':"red", '4':"purple", '5':"orange", '6':"blue", '7':"red", '8':"orange", '9':"orange", '0':"yellow", '!':"red", '@':"red", '#':"blue", '$':"green", '%':"yellow", '^':"green", '&':"red", '*':"yellow", '+':"orange", '-':"orange", '_':"yellow", '.':"blue", '|':"green", '?':"green", '{':"orange", '}':"orange", '=':"green", '~':"yellow", "'":"purple", '"':"purple", "(":"yellow", ")":"yellow", "/":"green", "<":"green", ">":"green", ";":"purple", "[":"red", "]":"red", ":":"cyan"};
var colorhexes = {
"red": "#ff6666",
"orange": "#ff9933",
"yellow": "#ffff66",
"gr
#!/bin/bash
cert_src="/home/admin/conf/web/ssl.tesla.m0k1.net.pem"
key_src="/home/admin/conf/web/ssl.tesla.m0k1.net.key"
cert_dst="/usr/local/vesta/ssl/certificate.crt"
key_dst="/usr/local/vesta/ssl/certificate.key"
if ! cmp -s $cert_dst $cert_src
then
# Copy Certificate
@m0k1
m0k1 / gist:d20d544bf38abe12fdc5b57c9d87acae
Created August 1, 2017 05:08 — forked from marty-wang/gist:5a71e9d0a6a2c6d6263c
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@m0k1
m0k1 / my-awesome-list.md
Last active January 20, 2018 21:47
Projects I like :)

PHP

Frameworks and lib's i love.

  • IceFramework - Simple and fast PHP framework delivered as C-extension. (Fast for apis)
  • whoops - PHP errors for cool kids
  • Hybridauth - Open source social sign on PHP Library.
  • Intervention Image - PHP Image Manipulation
  • Medoo - The lightest PHP database framework to accelerate development
  • Monolog - Sends your logs to files, sockets, inboxes, databases and various web services
  • dbv.php - Database version control, made easy!