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
#!/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 / 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
@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 / 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 / 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 / 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 / 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 / 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 / xgoto.pwn
Created May 28, 2015 15:25
xgoto by m0k1
#include <sscanf2> // By Y_Less, 2.8.2: http://forum.sa-mp.com/showthread.php?t=570927
#include <YSI\y_commands> // By Y_Less, f4d85a8: http://forum.sa-mp.com/showthread.php?t=570884
#include <YSI\y_master> // By Y_Less, f4d85a8: http://forum.sa-mp.com/showthread.php?t=570884
YCMD:xgoto(playerid, params[], help)
{
new string[256], Float:x,Float:y,Float:z;
if(sscanf(params, "fff", x,y,z)) return SendClientMessage(playerid, -1, ""#SMCOLOR"[SM:CMD] {FFFF00}/xgoto [x] [y] [z]");
format(string, sizeof(string), ""#SMCOLOR"[SM] {FFFF00}Portovao si se do %f %f %f", x,y,z);
SendClientMessage(playerid, COLOR_LIGHTRED2, string);
@m0k1
m0k1 / check_id_exist.php
Created May 15, 2015 07:27
Check if ID exist in database
<?php
$mysql_server = "localhost";
$mysql_user = "username";
$mysql_password = "password";
$mysql_dbname = "db";
$mysqlcon = new mysqli($mysql_server, $mysql_user, $mysql_password, $mysql_dbname);
if ($mysqlcon->connect_error) {
die("Connection failed: " . $mysqlcon->connect_error);
}