Skip to content

Instantly share code, notes, and snippets.

@kazu634
kazu634 / ipaddr_ubuntu.sh
Created October 30, 2011 08:22
Get the IP address the DHCP server assigns and make it a static one for Ubuntu
#!/bin/bash
# Set the LANG to C
LANG=C
# Acquiring the IP address
echo "[`date '+%Y/%m/%d %H:%M:%S'`] Acquiring the IP address." >> /tmp/static_ip.log
IP=`/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2;}' | cut -f2 -d':'`
#!/usr/bin/env perl
# === Libraries ===
use strict;
use warnings;
use Perl6::Say;
use utf8;
use Encode;
Snippet development
Quickly finding snippets
There are some ways you can quickly find a snippet file:
*
M-x yas/new-snippet
Prompts you for a snippet name, then tries to guess a suitable directory to store it, prompting you for creation if it does not exist. Finally, places you in a new buffer set to snippet-mode so you can write your snippet.
;; 第1回 Scheme コードバトン
;;
;; ■ これは何か?
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。
;; 次回 Shibuya.lisp で成果を発表します。
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。
;;
;; ■ 2 つのルール
;;
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。