Skip to content

Instantly share code, notes, and snippets.

@BrunIF
BrunIF / export-table.php
Created August 30, 2012 15:21 — forked from navitronic/export-table.php
MySQL table to csv
<?php
/*** mysql hostname ***/
$hostname = 'localhost';
$dbname = 'dbname';
/*** mysql username ***/
$username = 'username';
@BrunIF
BrunIF / gist:4583644
Last active December 11, 2015 09:59
// send resources from 6 cities in the capital after 3 hours.
// tree = 198000 and stone = 198000
intervalID = setInterval (function(){
var time = new Date().getTime();
$.get('http://www.suspilstvo.com/society/actions/actions.php?my_p_id='+txt_myid_txt+'&action=sendKars&cityN=1&from_city='+txt_myid_txt+'_2&to_city='+txt_myid_txt+'_1&own=1&wood=198000&stone=198000&iron=0&food=0&jantar=0&rubin=0&swords=0&bows=0&_='+time);
$.get('http://www.suspilstvo.com/society/actions/actions.php?my_p_id='+txt_myid_txt+'&action=sendKars&cityN=1&from_city='+txt_myid_txt+'_3&to_city='+txt_myid_txt+'_1&own=1&wood=198000&stone=198000&iron=0&food=0&jantar=0&rubin=0&swords=0&bows=0&_='+time);
$.get('http://www.suspilstvo.com/society/actions/actions.php?my_p_id='+txt_myid_txt+'&action=sendKars&cityN=1&from_city='+txt_myid_txt+'_4&to_city='+txt_myid_txt+'_1&own=1&wood=198000&stone=198000&iron=0&food=0&jantar=0&rubin=0&swords=0&bows=0&_='+time);
$.get('http://www.suspilstvo.com/society/actions/actions.php?my_p_id='+txt_myid_tx
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
#!/bin/bash
echo "Select on option:"
echo "1) Set up new PoPToP server AND create one user"
echo "2) Create additional users"
read x
if test $x -eq 1; then
echo "Enter username that you want to create (eg. client1 or john):"
read u
echo "Specify password that you want the server to use:"
read p
@BrunIF
BrunIF / gist:262fe6d296c4092a078b
Last active August 29, 2015 14:03
Jivosite Custom Language
<?php
$lang =& JFactory::getLanguage();
//$lang->getTag();
if ($lang->getTag() == 'en-GB') {
echo <<<ENG
<!-- BEGIN JIVOSITE CODE {literal} -->
<script type='text/javascript'>
(function(){ var widget_id = '166324';
@BrunIF
BrunIF / gist:2ab9ac37e6d04403c226
Created October 15, 2014 15:56
Thief IP Address
brun@HP-ProBook-4530s:~ > sudo nmap -v -A nung.edu.ua
Starting Nmap 6.00 ( http://nmap.org ) at 2014-10-15 18:49 EEST
NSE: Loaded 93 scripts for scanning.
NSE: Script Pre-scanning.
Initiating Ping Scan at 18:49
Scanning nung.edu.ua (194.44.112.88) [4 ports]
Completed Ping Scan at 18:49, 1.02s elapsed (1 total hosts)
Initiating SYN Stealth Scan at 18:49
Scanning nung.edu.ua (194.44.112.88) [1000 ports]
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
@BrunIF
BrunIF / pps.sh
Last active August 29, 2015 14:24 — forked from pavel-odintsov/pps.sh
#!/bin/bash
INTERVAL="1" # update interval in seconds
if [ -z "$1" ]; then
echo
echo usage: $0 [network-interface]
echo
echo e.g. $0 eth0
echo