Skip to content

Instantly share code, notes, and snippets.

@arifnd
arifnd / naya_task.py
Created July 3, 2014 11:47
show gtk windows list
#!/usr/bin/python
import gtk
import wnck
from time import time
class NayaTask:
def __init__(self):
self.screen = wnck.screen_get_default()
@arifnd
arifnd / slack-Incoming-webhooks.sh
Created August 23, 2014 04:11
bash scrip to send Slack Incoming WebHooks
#!/bin/bash
token=
parm="payload={\"channel\": \"$1\", \"username\": \"$2\",\"text\": \"$3\"}"
curl -X POST --data-urlencode "$parm" $token
@arifnd
arifnd / 0_reuse_code.js
Created August 27, 2014 21:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@arifnd
arifnd / Dockerfile
Created December 24, 2016 19:49
official no-ip Dynamic DNS Update client Dockerfile for Odroid C2
FROM arifnd/c2-alpine
RUN apk add --update --virtual .build-dependencies tar build-base && \
wget -qO noip.tar.gz http://www.noip.com/client/linux/noip-duc-linux.tar.gz && \
mkdir noip && tar -C noip --strip-components=1 -xvf ./noip.tar.gz && \
cd noip && sed -i '/no-ip2/d' Makefile && make install && \
apk del .build-dependencies && rm -rf /var/cache/apk/* && rm ../noip.tar.gz
CMD noip2; while pgrep noip > -; do echo "Process is running"; sleep 5; done; echo "No-ip has died"; exit 1
# B
alias b='clear'
alias blow='tar zxvf'
# C
alias c='codium'
alias cr='composer require'
alias cin='composer install'
# F
@arifnd
arifnd / cloudSettings
Last active January 28, 2021 08:31
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-01-28T08:31:21.372Z","extensionVersion":"v3.4.3"}
<?php
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);
$host = '127.0.0.1';
$ports = array(22, 80, 443, 3306);
foreach ($ports as $port)
{
$connection = @fsockopen($host, $port, $errno, $errstr, 2);
http://gg.gg/php-port-status
<?php
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);
$host = '127.0.0.1';
$ports = array(80, 443, 3306);
$mem = @file_get_contents('/proc/meminfo');
$mem = preg_replace("/[[:blank:]]+/", " ", $mem);
$mem = str_replace(array("\r\n", "\n\r", "\r"), "\n", $mem);
@arifnd
arifnd / for-server-openvz.conf
Last active July 22, 2020 15:19
Wireguard Config
[Interface]
Address = 10.10.10.1/24
PrivateKey =
ListenPort = 10101
#PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o venet0 -j MASQUERADE;
#PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o venet0 -j MASQUERADE;
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o vnet0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o vnet0 -j MASQUERADE
[Peer]