Skip to content

Instantly share code, notes, and snippets.

View gadelkareem's full-sized avatar
🎯
Focusing

Gadelkareem gadelkareem

🎯
Focusing
View GitHub Profile
@arunoda
arunoda / gist:7790979
Last active February 16, 2024 14:05
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@kimus
kimus / ufw.md
Created March 2, 2014 22:46
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

@peterhellberg
peterhellberg / api.go
Last active January 18, 2019 01:58
A tiny example API written in Go using Martini and Redigo
package main
import (
"flag"
"fmt"
"net/http"
"github.com/codegangsta/martini"
"github.com/garyburd/redigo/redis"
"github.com/martini-contrib/render"
---
- include_vars: secrets.yml
- apt: pkg=fuse state=absent
- apt: pkg={{ item }} state=present update_cache=yes
with_items:
- build-essential
- libcurl4-openssl-dev
- libxml2-dev
- mime-support
@tonymtz
tonymtz / gist:714e73ccb79e21c4fc9c
Created November 15, 2014 00:02
Uninstall XQuartz.app from OSX Yosemite
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in
@gadelkareem
gadelkareem / warmup.php
Created January 18, 2015 16:57
If you are minifying scripts and css files using a caching plugin or using FastCGI cache then you might need to warmup your blog after purging your cache. This is a simple warm up cli script for WordPress to initiate cache or HHVM HHBC and making sure all pages/posts do not have errors. Additionally the script creates a urllist.txt file that you…
<?php
if (PHP_SAPI != 'cli') {
header('Status: 403 Forbidden');
header('HTTP/1.1 403 Forbidden', true, 403);
exit();
}
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
@Roland09
Roland09 / TableCopyCellsDemo.java
Created February 11, 2015 18:07
Example about copying multiple selected table cells to the clipboard. Select the cells and press CTRL+C. The clipboard data can then be pasted into Excel, Notepad, etc. Copy works, Paste operation will be added in a separate gist.
import javafx.application.Application;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.SelectionMode;
import javafx.scene.control.TableColumn;
@wolfhechel
wolfhechel / Vagrantfile
Created March 14, 2015 13:23
nftables router
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@potter0815
potter0815 / cloneall.sh
Last active January 30, 2024 13:07
clone all private repos of an organization
#!/bin/bash
#requires jq -> http://stedolan.github.io/jq/
#optional change working_dir
working_dir=${1-$(pwd)}
cd $working_dir
user="github_username"
token="application token"
organization="Organization_Name"
@blindpet
blindpet / purgevarnishsingle
Last active May 20, 2023 09:51
clear one url home page varnish cache
Enter varnish admin
varnishadm
clear cache for index home page only
ban req.http.host ~ www.htpcguides.com && req.url ~ "^/$"
clear cache for specific page