Skip to content

Instantly share code, notes, and snippets.

View itbj's full-sized avatar
🌴
On vacation

taoza itbj

🌴
On vacation
View GitHub Profile
@yaegashi
yaegashi / playbook.yml
Created October 14, 2015 12:05
Ansible SSH connection using paramiko
---
- hosts: all
connection: paramiko
vars:
ansible_ssh_private_key_file: /path/to/private_key
ansible_ssh_pass: passphrase_for_private_key
tasks:
- debug:
msg: hello
@iest
iest / README.md
Last active August 11, 2022 09:20
Setting up environment variables with various shells

What the hell are environment variables?

They're just variables you set on your system that various programs/processes can read. A fairly standard example in javascript circles would be setting your NODE_ENV variable to "production" or "development", altering how node code is executed on your system (for example showing more debug messaging when in development).

With most shells there's a way to set them for the current session, and a way to set them for all sessions. The following is meant to be a guide on how to set env vars in the various shells.

Bash (The default shell on OSX)

Setting for the session:

@twr14152
twr14152 / EEM Config-change-alert
Created June 17, 2015 17:52
EEM Cisco - config change Alert - with email and syslog capturing user name and config commands
archive
log config
logging enable
notify syslog contenttype plaintext
hidekeys
event manager applet Config_Change authorization bypass
event config
action 1.1 cli command "enable"
@taylor224
taylor224 / wifi.py
Last active February 8, 2024 15:22
Python WiFi Example
# -*- coding: utf-8 -*-
import wifi
def Search():
wifilist = []
cells = wifi.Cell.all('wlan0')
@shello
shello / randomEmoji.py
Last active October 5, 2023 09:16
Random Emoji! (for Python 3)
#!/usr/bin/env python3
from itertools import accumulate
from bisect import bisect
from random import randrange
from unicodedata import name as unicode_name
# Set the unicode version.
# Your system may not support Unicode 7.0 charecters just yet! So hipster.
UNICODE_VERSION = 6
@yuuichi-fujioka
yuuichi-fujioka / install_start_stop_daemon.sh
Created June 7, 2014 15:11
install start-stop-daemon to centos, fedora, redhat.
#!/bin/bash
cd /usr/local/src
wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
cd apps/sys-utils/start-stop-daemon-IR1_9_18-2
gcc start-stop-daemon.c -o start-stop-daemon
cp start-stop-daemon /usr/sbin/
@labnol
labnol / index.html
Created April 30, 2014 13:27
Google Maps
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d56790.47490202523!2d78.042155!3d27.175014999999924!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x39747121d702ff6d%3A0xdd2ae4803f767dde!2sTaj+Mahal!5e0!3m2!1sen!2s!4v1398864446719" width="800" height="600" frameborder="0" style="border:0"></iframe>
@fleeto
fleeto / gist:9912971
Last active April 8, 2022 17:39
Drupal黑话入门

Drupal可能会让初学者深感畏惧。对大多数人来说,第一只拦路虎就是Drupal世界中一系列的术语,这些术语有的很生僻,有的在不同语境中有着不同的含义。要尽快的融入Drupal社区,同其他的Drupal爱好者沟通,最好能尽快的理解和使用Drupal的这些词汇。这里列出一些常用的Drupal术语。

Block - (这里保持原文,因常用的汉语翻译区块很容易和下句话中的区域混淆——译者注) Block用于将一小片内容摆放到页面的指定区域(例如左侧边栏,头部或底部等),例如一个包含了公司联系信息的Block可以放置到所有页面底部。或者将一个包含了相关商品的Block展示在一个目录下所有商品的详情页中。

Core - 也就是核心,指的是在Drupal.org下载的标准Drupal包中包含的缺省功能。这些功能包含Menu(Menu实际上和我们软件行业常说的菜单有很大区别,指的不是菜单,而是Drupal的Url系统——译者注)管理,用户管理,系统管理,设计和布局,以及分类系统等等。

Contrib - 是Drupal社区成员将一些新增的或变更的功能,以主题和模块的形式进行发布。这些模块和主题可以从 https://drupal.org/download 进行下载。

d.o - dropal.org的简称。发音为dee dot oh。

@itbj
itbj / t2.php
Created January 26, 2014 09:17
My PHP application to read file ,then put on the Web Browser. (2014/01/26)
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
<?php
echo "My Cloud App!<br>我的云应用。<br>";
echo $showtime=date("Y-m-d H:i:s");
echo "<hr>";
$filename="yjm.txt";
if (file_exists($filename))
@anthonyeden
anthonyeden / Python WExpect
Created January 18, 2014 10:40
Python's PExpect for Microsoft Windows: WExpect
"""Pexpect is a Python module for spawning child applications and controlling
them automatically. Pexpect can be used for automating interactive applications
such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different servers. It
can be used for automated software testing. Pexpect is in the spirit of Don
Libes' Expect, but Pexpect is pure Python. Other Expect-like modules for Python
require TCL and Expect or require C extensions to be compiled. Pexpect does not
use C, Expect, or TCL extensions. It should work on any platform that supports
the standard Python pty module. The Pexpect interface focuses on ease of use so
that simple tasks are easy.