This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'term) | |
(defun visit-ansi-term () | |
"If the current buffer is: | |
1) a running ansi-term named *ansi-term*, rename it. | |
2) a stopped ansi-term, kill it and create a new one. | |
3) a non ansi-term, go to an already running ansi-term | |
or start a new one while killing a defunt one" | |
(interactive) | |
(let ((is-term (string= "term-mode" major-mode)) | |
(is-running (term-check-proc (buffer-name))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "msgpack" | |
require "socket" | |
class Bar | |
end | |
class Server | |
attr_accessor :server, :exit_now | |
def initialize | |
@server = TCPServer.new("0.0.0.0", 8123) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "heapdatamodel.h" | |
namespace RBKit { | |
HeapDataModel::HeapDataModel(HeapItem * _item, QObject *parent) | |
: QAbstractItemModel(parent), rootItem(_item) | |
{ | |
} | |
HeapDataModel::~HeapDataModel() { | |
// delete items; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "sortobjectproxymodel.h" | |
SortObjectProxyModel::SortObjectProxyModel(QObject *parent) : | |
QSortFilterProxyModel(parent) | |
{ | |
} | |
bool SortObjectProxyModel::hasChildren(const QModelIndex &parent) const | |
{ | |
const QModelIndex sourceIndex = mapToSource(parent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(source gnu) | |
(source marmalade) | |
(source melpa) | |
(depends-on "[cl-struct-package-desc git-gutter-fringe (20131117 2335) Fringe version of git-gutter.el [github] ((git-gutter (0 42)) (fringe-helper (0 1 1))) single melpa nil]") | |
(depends-on "[cl-struct-package-desc icicles (20140115 354) Minibuffer input completion and cycling. nil tar melpa nil nil nil]") | |
(depends-on "[cl-struct-package-desc smart-mode-line (20131126 1625) A color coded smart mode-line. ((emacs (24 3)) (dash (2 2 0))) single melpa nil]") | |
(depends-on "[cl-struct-package-desc zenburn-theme (20131119 1158) A low contrast color theme for Emacs. nil single melpa nil]") | |
(depends-on "ac-js2") | |
(depends-on "ace-jump-mode") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "3.0.0", | |
"gauges": { | |
"jvm.gc.heap.max": { | |
"value": 123 | |
} | |
}, | |
"counters": { | |
"big_messages,dim1=val1,dim2=val2": { | |
"count": 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type Foo struct { | |
whitelist []string | |
} | |
func main() { | |
foo := new(Foo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ystemd 229 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN) | |
Detected virtualization docker. | |
Detected architecture x86-64. | |
Welcome to Fedora 24 (Twenty Four)! | |
Set hostname to <a6456c8481a4>. | |
Cannot determine cgroup we are running in: No medium found | |
Failed to allocate manager object: No medium found | |
[!!!!!!] Failed to allocate manager object, freezing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For a lot of distros the /etc/resolv.conf is autogenerated by NetworkManager or dhcp-client, in those cases usually | |
/etc/resolv.conf contains a warning like: | |
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) | |
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN | |
From Ubuntu Server Guide | |
========================= | |
Traditionally, the file /etc/resolv.conf was a static configuration file that rarely needed to be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modify this file accordingly for your specific requirement. | |
# http://www.thegeekstuff.com | |
# 1. Delete all existing rules | |
iptables -F | |
# 2. Set default chain policies | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP | |
iptables -P OUTPUT DROP |