teleren/devto huggingface dataset:
Gradleでマルチプロジェクト
Tags: java, gradle
Published: 2013-07-30 18:16:00

---
title: Gradleでマルチプロジェクト
published: true
tags: Java, gradle
date: 20130730T18:16Z
canonical_url: https://qiita.com/shiena/items/371fe817c8fb6be2bb1e
---
Gradleは単一プロジェクトだけではなく複数のプロジェクトをまとめて扱うことができて、マルチプロジェクトと呼んでいます。
マルチプロジェクトではいくつかのレイアウトがあるので、以下の3つのプロジェクトを例に書いてみます。

* `root` プロジェクトをまとめるためのプロジェクト
* `share` 共通機能をまとめたプロジェクト
* `application` アプリケーションがあるプロジェクトで`share`プロジェクトに依存しています。

`build.gradle`の書き方は[Gradle User Guide/7.3. マルチプロジェクトのJavaビルド](http://gradle.monochromeroad.com/docs/userguide/tutorial_java_projects.html#sec:examples)などが詳しいため、ここでは割愛します。

## 階層構造のレイアウト

`root`配下に`share`と`application`を配置する見た目で分かりやすいレイアウトです。
Gradleのビルドファイルである`build.gradle`と`settings.gradle`は`root`直下に配置します。

```text:Hierarchical-Layout
root/
  share/
  application/
  build.gradle
  settings.gradle
```

`settings.gradle`には`include`に続けてプロジェクト名を書きます。

```groovy:settings.gradle
include 'share', 'application'
```

## フラットなレイアウト

Eclipseなどで扱いやすいように全てのプロジェクトを同じ階層に配置するレイアウトです。
`build.gradle`と`settings.gradle`はそのままで、`share`と`application`が`root`と同じ階層にあります。
ただし、このレイアウトでは`root`以外でビルドできません。

```text:Flat-Layout
root/
  build.gradle
  settings.gradle
share/
application/
```

`settings.gradle`は`include`を`includeFlat`に変更するだけです。

```groovy:settings.gradle
includeFlat 'share', 'application'
```

### masterを使ったフラットなレイアウト

**※追記**

フラットなレイアウトの特別パターンで、`root`ディレクトリの名前を`master`にすれば他のプロジェクトからビルドできます。
この場合は同じ階層の`master`ディレクトリの中に`settings.gradle`があればマルチプロジェクトとして扱われるようです。

参考: [Gradle User Guide/第53章 ビルドのライフサイクル/53.4. 初期化](http://gradle.monochromeroad.com/docs/userguide/build_lifecycle.html#sec:initialization)

```text:Flat-Layout(master)
master/
  build.gradle
  settings.gradle
share/
application/
```

## もう1つのフラットなレイアウト

フラットなレイアウトでも各プロジェクトでビルドできるように配置したものです。
最初のフラットなレイアウトから更に`settings.gradle`を各プロジェクトと同じ階層に配置します。

```text:Another-Flat-Layout
root/
  build.gradle
share/
application/
settings.gradle
```

`settings.gradle`でルートプロジェクトの名前とディレクトリを設定します。
Gradleはカレントディレクトリに`settings.gradle`が無い場合は上位のディレクトリを順に探してくれるので、どのプロジェクトからでもビルドできるようになります。

```groovy:settings.gradle
rootProject.name = 'root'
rootProject.projectDir = new File(settingsDir, 'root')

includeFlat 'share', 'application'
```
IntelliJのエディタにSublimeText風のmini-mapを表示するプラグイン
Tags: intellij
Published: 2013-09-29 17:27:00

---
title: IntelliJのエディタにSublimeText風のmini-mapを表示するプラグイン
published: true
tags: IntelliJ
date: 20130929T17:27Z
canonical_url: https://qiita.com/shiena/items/84715774551d3c9e1e85
---
## インストール手順

Settings -> Plugins -> Browse repositories... -> CodeGlance

## 開発元

githubでソースが公開されています。スクリーンショットもあります。

[Vektah/CodeGlance](https://github.com/Vektah/CodeGlance)

## 配布元

JetBrainsのプラグインリポジトリです。こっちも同じスクリーンショットがあります。

[CodeGlance](http://plugins.jetbrains.com/plugin/7275)
Bookreview Instant jqGrid by Gabriel Manricks
Tags: jquery, jqgrid
Published: 2020-11-05 10:23:34

---
title: Bookreview Instant jqGrid by Gabriel Manricks
published: true
date: 2013-09-29 07:00:00 UTC
tags: jquery,jqgrid
canonical_url: 
---

[_JqGrid_](http://www.trirand.com/jqgridwiki/doku.php) _is an ajax enabled jQuery plugin for showing and editing data in a grid. I’ve been using jqGrid extensively throughout my projects, and created an_ [_Html Helper_](https://github.com/robinvanderknaap/MvcJqGrid) _to ease the implementation in ASP.NET MVC. Because of my experience with jqGrid, Packt publishing asked me to review one of their latest books,_ [_Instant jqGrid by Gabriel Manricks_](http://bit.ly/1an91tS)_._

The book is mainly focused on people starting with jqGrid, experienced users will probably know most of the stuff that is written in the book and is of no added value to them.

The book can be divided in two parts. The first part teaches the jqGrid basic concepts, installation and walks you through the steps of creating your first grid. The second and biggest part is called ‘Top 7 features you need to know about’ and takes a deep dive in the most important features of jqGrid.

Covered in the second part are formatters, adding controls, editing data, connecting to a backend server and a description of some common methods and events of the jqGrid API. I especially liked the the example of connecting jqGrid to the backend. The backend code is written in PHP, but should easily be understood by developers of other platforms. The example shows how to retrieve data from the server, and page, search and edit data on the server, which are the core features of jqGrid. The author describes every step thoroughly and in a clear and simple form.

What I missed in the book is how to deal with custom styling. It is mentioned you can use jQuery UI themeroler, but doesn’t give any information or example how to further customize the styling of the grid. Also I thought it was too bad the author did not mention the option of virtual scrolling when describing the pager, which I like very much and is easy to implement.

The book is very easy to read and to follow. After going through the book, and the examples, a developer should have a sound knowledge of jqGrid, and be able to customize the grid to their needs. I remember the pain going through the online documentation and examples when I first started with jqGrid, this book is a real time-saver for people who want to start working with jqGrid. Not every feature or option is covered in the book, it only counts 58 pages, but I think gives you enough baggage to get started and explore more features, like subgrids, treegrids and data grouping, on your own using the online documentation and examples.
Enable AngularJS HTML5 Routing on IIS
Tags: urlrewrite, angular, iis
Published: 2013-09-18 14:57:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Enable AngularJS HTML5 Routing on IIS
slug: enable-angularjs-html5-routing-on-iis
date: 2013-09-18 14:57
tags: 
 - url-rewrite
 - angularjs
 - iis
---
AngularJS has the ability to use HTML5 routing, which means that rather than having your application using a hash (#) sign and then the route, it can instead get rid of the hash and still function as a Single Page Application. For example:

    Without HTML5 routing: http://domain.com/#/user/15 -> http://domain.com/index.html
    With HTML5 routing: http://domain.com/user/15 -> http://domain.com/index.html

For this to work though, you'll need to set up some sort of server-side url rewriting. To do this in IIS, you should first download and install the URL Rewrite module (Web Platform Installer will have it). After that, we need to set up some rules. 

If you want the step by step version, follow this:

1. Open up the site in question and go to URL Rewrite module.
2. Add an inbound rule, name it "AngularJS Conditions". Set the pattern to match all directories you want to exclude, I use `(app/.*|assets/.*|common/.*)`. Change the action to `None`, and click Apply.
3. Add another inbound rule, name it "AngularJS Wildcard". Set the pattern to `(.*)`, keep the action as `Rewrite` and put in the relative URL to your `index.html`, and click Apply.
4. Test your site. 
5. If your css/js requests are being rewritten, you have a problem with your conditions rule. 
6. If you're getting 404.0 errors, you have a problem with your wildcard rule. 
5. Get back to work.

If you're impatient and just want the web.config, well, here you go:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
            <clear />
            <rule name="AngularJS Conditions" stopProcessing="true">
              <match url="(app/.*|assets/.*|common/.*|modules/.*|config/.*)" />
              <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
              <action type="None" />
            </rule>
            <rule name="AngularJS Wildcard" enabled="true">
              <match url="(.*)" />
              <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
              <action type="Rewrite" url="index.html" />
            </rule>
          </rules>
        </rewrite>
      </system.webServer>
    </configuration>

You should now be set up for HTML5 routing.
Enable cross-origin resource sharing (CORS) in IIS
Tags: iis, webapi, cors, webconfig
Published: 2013-09-18 12:21:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Enable cross-origin resource sharing (CORS) in IIS
slug: enable-cross-origin-resource-sharing-cors-in-iis
date: 2013-09-18 12:21
tags: 
 - iis
 - webapi
 - cors
 - web-config
---
If you're hosting your API on a different domain to your app, such as api.domain.com, you may be hitting into some cross-origin request roadblocks. In IIS, this is pretty easy to fix -- or well -- disable.

In your WebAPI project's web.config, put in the following:

    <httpProtocol>
        <customHeaders>
            <add name="Access-Control-Allow-Origin" value="*" />
            <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />
        </customHeaders>
    </httpProtocol>

This will enable cross-origin resource sharing (CORS) and allow you to get back to work.
Force JSON with WebAPI
Tags: webapi, json, api, csharp
Published: 2013-09-18 11:17:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Force JSON with WebAPI
slug: force-json-with-webapi
date: 2013-09-18 11:17
tags:
 - webapi
 - json
 - api
 - csharp
---
Sometimes when you call a WebAPI through the browser, you'll be served XML. This may make it easier to read, but it's really not helping us when all we really want is JSON. Putting the following snippet into the end of Application_Start() in Global.asax.cs will force your WebAPI application to always send JSON.

    GlobalConfiguration.Configuration.Formatters.Clear();
    GlobalConfiguration.Configuration.Formatters.Add(new JsonMediaTypeFormatter());

As simple as that.
Install Emmet (Zen Coding) in Sublime Text
Tags: sublimetext, emmet, zencoding
Published: 2013-09-11 21:30:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Install Emmet (Zen Coding) in Sublime Text
slug: install-emmet-zen-coding-in-sublime-text
date: 2013-09-11 21:30
tags: 
 - sublimetext
 - emmet
 - zen-coding
---
For those who don't know, Zen Coding -- or [Emmet](http://docs.emmet.io/) as it's now known -- is a set of plugins for text editors that allow for high-speed coding and editing in HTML, XML, XSL, and other structured code formats via content assist. (Thanks Wikipedia!)

If you don't already use this, you should, and I'm going to show you (or future me) how to install it for Sublime Text. Note that 'merican users will have to use a different key binding, so if a menu doesn't pop up, try some other key combinations.

The first thing you want to do is open up Sublime Text. If you don't already have the package manager installed, then install it by bringing up the console `Ctrl` + `'` (in Linux you may need to use `Ctrl` + `) and pasting in:

    import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

Press enter and wait for that to install. Once complete, press `Ctrl` + `Shift ` + `P` to bring up the command palette and type `Install`, press enter to select `Package Control: Install package`. 

This should pop up a new menu where you can now type `Emmet` and press enter. Give it a few seconds to install and now you're good to go, you have Emmet -- or Zen Coding -- installed and can write your HTML and CSS more efficiently.
Increase playback speed on YouTube
Tags: youtube, videos
Published: 2013-09-08 15:28:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Increase playback speed on YouTube
slug: increase-playback-speed-on-youtube
date: 2013-09-08 15:28
tags: 
 - youtube
 - videos
---
I don't know if you're impatient like me, but if you are, you probably get sick of watching tutorial/education videos on 1.0x speed playback. I went through Jon Skeet's C# videos on 1.5x - 2.0x times the speed, but YouTube chugs along on 1.0x and it takes so damn long. Just get to the point OP!

But there is a way I have discovered to gain some control over this, by forcing the video to play in the new HTML5 video player which should give you access to playback speed control on the same popup menu that you select the quality from.

Take your video ID, in this case, `1CQ0zDfX4QE` from your current URL which should look like this:

> http://www.youtube.com/watch?v=1CQ0zDfX4QE

And replace `watch` with `watch_popup` and add `&vq=large` to the end of the URL, like so:

> http://www.youtube.com/**watch_popup**?v=1CQ0zDfX4QE**&vq=large**

Now you'll be able to see the speed control from the quality popup. Hallelujah! 

![Bingo!](http://i.imgur.com/mJnXYGb.png)
lightline.vimとvim-anzuで検索ヒット数を表示する
Tags: vim
Published: 2013-09-01 17:19:00

---
title: lightline.vimとvim-anzuで検索ヒット数を表示する
published: true
tags: Vim
date: 20130901T17:19Z
canonical_url: https://qiita.com/shiena/items/f53959d62085b7980cb5
---
この内容は以下の記事を元にしたlightline.vim版になります。

* [VAC2012とvim-anzuとvim-airline](http://lsifrontend.hatenablog.com/entry/2013/08/20/225913)

先日、以下の投稿でlightline.vimを導入した後に、上の記事を知って同じ事をやりたくなったのでカスタマイズしてみました。

* [vimのstatusline装飾プラグインのlightline.vimを導入してみた](http://qiita.com/shiena/items/a75d252e3814ad6ff7de)

## カスタマイズ後の見た目

画像は NeoBundle を検索して47件中、2件目に移動した結果をファイル名の右側に表示したものです。

![MacVim_anzu.png](https://dev-to-uploads.s3.amazonaws.com/i/yqr8lycrpq1lpz9if75x.png)

# カスタマイズ内容

```vim:.vimrc
" lightline.vim関連 {{{
let g:lightline = {
    \ 'colorscheme': 'landscape',
    \ 'active': {
    \   'left': [
    \       ['mode', 'paste'],
    \       ['readonly', 'filename', 'modified', 'anzu']
    \   ]
    \ },
    \ 'component_function': {
    \   'anzu': 'anzu#search_status'
    \ }
    \ }
"}}}

" vim-anzu関連 {{{
nmap n <Plug>(anzu-n)
nmap N <Plug>(anzu-N)
nmap * <Plug>(anzu-star)
nmap # <Plug>(anzu-sharp)
augroup vim-anzu
" 一定時間キー入力がないとき、ウインドウを移動したとき、タブを移動したときに
" 検索ヒット数の表示を消去する
    autocmd!
    autocmd CursorHold,CursorHoldI,WinLeave,TabLeave * call anzu#clear_search_status()
augroup END
"}}}
```

## lightline.vimの設定

1. `anzu#search_status()`が検索ヒット数を出力するので、`component_function`にキー`anzu`で登録します。
1. 表示位置はキャプチャ画像の青い部分のファイル名の右側にしたいので、先程登録した`anzu`を`g:lightline.active.leftの2つ目のリストの最後に追加します。

また、`anzu`の位置を変えれば表示位置も変わります。
たとえば左端の白い場所に表示したいなら、1つ目のリストに追加します。

## vim-anzuの設定

`n`, `N`, `*`, `#`のキーマップは[vim-anzuのExample](https://github.com/osyo-manga/vim-anzu#example)と一緒ですが、消去は以下のタイミングで自動実行しています。

* 一定時間キー入力がないとき (CursorHold,CursorHoldI)
* ウインドウを移動したとき (WinLeave)
* タブを移動したとき (TabLeave)
sudoコマンドの公式な発音
Tags: sudo, pronunciation
Published: 2013-09-01 04:26:00

---
title: sudoコマンドの公式な発音
published: true
tags: sudo, pronunciation
date: 20130901T04:26Z
canonical_url: https://qiita.com/shiena/items/ee76bc85560104399e7e
---
話のネタになるコマンドの発音について、`sudo`は公式な発音があるようです。
Sudo Main Pageの[FAQ and Troubleshooting Tips](http://www.sudo.ws/sudo/troubleshooting.html)に次のFAQがあります。

> Q) How do you pronounce `sudo'?
> A) The official pronunciation is soo-doo (for su "do").  However, an
>    alternate pronunciation, a homophone of "pseudo", is also common.

ここで soo-doo なので「すどぅー」で決まりですね！

※追記

Chrome限定ですがGoole翻訳で[soo-doo](http://translate.google.co.jp/#en/ja/soo-doo)の発音を聞くことができます。
Back on the web
Tags: general
Published: 2013-08-31 10:36:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Back on the web
slug: back-on-the-web
date: 2013-08-31 10:36
tags: 
 - general
---
Well, after 30 days of silence, the site is back on the web.

I have now successfully completed my 120 mile move from North West England to Middle England and with the internet back online and working, the site returns. It's been a difficult few weeks without the internet, I have resorted to doing things like going for walks, reading fiction books and just eating very slowly and thinking about things whilst looking at a blank kitchen wall.

![What it's like to have no internet](http://i.imgur.com/XcwdXxi.png)

I also start a new job on Monday which is exciting, but I will continue to write, though the blog posts may not be quite so frequent. I will probably have some better topics to write about now though!

Wish me luck!
Audio and Old Androids
Tags: html, audio, android, javascript
Published: 2018-10-15 23:06:34

---
title: Audio and Old Androids
published: true
tags: html5,audio,android,javascript
canonical_url: http://designfrontier.net/audio-and-old-androids
---

I just got done working on a project that involved the use of the audio tag (with flash fallback for IE) and thought I would share a couple of the issues that we ran into in working on it, and how they were solved. For those of you interested in such things the project was the new Scripture Mastery activities for seminary students, high school students enrolled in a religion class sponsored by The Church of Jesus Christ of Latter-day Saints.

The project included all sorts of new ideas and thoughts, and is using a pretty custimized version of Backbone as the core of its client side operations. But I digress...

So audio tags. They are really pretty awesome, and they work pretty well in theory for everything that supports them. The problem is that there are some hangups in older versions of browsers that you would think wouldn't have any issues with them at all. I am looking at you Android browser.

We couldn't figure out why android browser, not chrome for android, but actual android browser, was having issues with our audio tag. For some reason it decided to balk completely, not even downloading the audio file. After we spent a couple of days expirmenting with solutions and different ways of structuring the data I though I would share so that you don't have to do the same thing.

The first thing you should know is that Android browser does not support audio over SSL. Not sure why that is. but it doesn't. We tried a variety of ways of structuring the audio tag, but if the source for the audio involved communicating over SSL it wouldn't even begin the request. So lesson #1 avoid SSL.

The second thing that we learned, was that the <source> tag doesn't seem to work either. This is actually a bigger problem in some ways. We wound up having to detect old versions of Android browser and serve them a different template for the audio component that used the src attribute instead of the <source> tags. If you are going to support older Androids then you might want to do something similar. The detection script we are using looks like this:</source></source>

```
var ua = navigator.userAgent.toLowerCase()
, is_android = ua.match(/android/gi) && ua.match(/crmo/gi) === null;
```

it is a modified version of one I found on stackoverflow and promptly lost. If you find the original let me know so I can link it up here.

Hopefully those two things will help save you the time that we spent tracking them down. Good luck out there in the trenches!
vimのstatusline装飾プラグインのlightline.vimを導入してみた
Tags: vim
Published: 2013-08-25 18:11:00

---
title: vimのstatusline装飾プラグインのlightline.vimを導入してみた
published: true
tags: Vim
date: 20130825T18:11Z
canonical_url: https://qiita.com/shiena/items/a75d252e3814ad6ff7de
---
vimのstatusline装飾プラグインは

* [vim-powerline](https://github.com/Lokaltog/vim-powerline)
* [powerline](https://github.com/Lokaltog/powerline)
* [vim-airline](https://github.com/bling/vim-airline)

上記のようにいくつかあります。そんな中で最近、更に新しいプラグインが出てきました。

* [lightline.vim作りました - プラグインの直交性について](http://d.hatena.ne.jp/itchyny/20130824/1377351527)

特徴として次のような事が挙げられています。

* vim scriptのみで書かれて軽量であること
* 簡単に拡張できること
* 他のプラグインに干渉しないように気を使っていること

powerlineは導入が面倒そうだったのでvim-airlineもそのまま見送っていたのですが、これなら面倒がなさそうで[landscape theme](https://github.com/itchyny/lightline.vim#landscape-theme-with-the-patched-font)も気に入ったので導入してみました。

カラーテーマだけ設定してみましたがデフォルトで色々と表示されるので、同系のプラグインを使ってない人でも導入する価値があると思います。

```vim:.vimrc
let g:lightline = {
	\ 'colorscheme': 'landscape'
	\ }
```

![lightline.vim](https://dev-to-uploads.s3.amazonaws.com/i/mwxlsr2bzugj5tgqgoj4.png)
vimでカーソル位置の行と列を強調表示する
Tags: vim
Published: 2013-08-25 03:47:00

---
title: vimでカーソル位置の行と列を強調表示する
published: true
tags: Vim
date: 20130825T03:47Z
canonical_url: https://qiita.com/shiena/items/3f51a2c0b4722427e430
---
vimで検索するとカーソルの位置を見失うことがあります。
そんなときは行や列を強調表示すると見やすくなります。

```vim:.vimrc
" 行を強調表示
set cursorline

" 列を強調表示
set cursorcolumn
```

![カーソル位置の行と列を強調表示](https://dev-to-uploads.s3.amazonaws.com/i/85vh333xok3c9ie3ba6q.png)

実際に使ってみると分かるのですが、常用すると強調表示が逆に邪魔になったり、描画も遅くてストレスになったりするのでmapでON/OFFを切り替えると使い勝手がよさそうです。

```vim:.vimrc
nnoremap <Leader>c :<C-u>setlocal cursorline! cursorcolumn!<CR>
```
MAC Spoofing under Linux
Tags: linux, mac, nsa, security
Published: 2019-08-08 13:39:03

---
title: MAC Spoofing under Linux
published: true
tags: linux,mac,nsa,security
canonical_url: https://www.zufallsheld.de/2013/08/07/mac-spoofing-under-linux/
---

The announcement of the recent [attacks on Tor-users](https://lists.torproject.org/pipermail/tor-announce/2013-August/000089.html) that exploit a Firefox vulnerability in Javascript suggested some things to remain anonymous whilst using Tor, such as disabling JavaScript, using the most recent versions of Firefox, install firewalls and so on. One interesting measure named was to often change your MAC address so there’s one less vector to identify you and your surfing behavior.

I thought to myself, why only use it with tor, why not always? There’s no reason not to do it. The term we’re looking for here is called [MACspoofing.](https://en.wikipedia.org/wiki/MAC_spoofing) There’s a short but interesting [paper](http://www.ijser.org/paper/Media_Access_Control_Spoofing_Techniques_and_its_Counter_Measures.html) discussing this topic. Be sure to read it.

A short search on the internet revealed, that there are already tools to help you accomplish the task. The application I use is called “[GNU MACChanger](https://github.com/alobbs/macchanger)” by Alvaro Lopez Ortega.

### Installation

On Arch Linux, the macchanger is in the AUR, Ubuntu has it in it’s Repos, too. So just install it with your favorite package manager:

On Arch Linux:

```
pakku -S macchanger
```

On Ubuntu:

```
apt-get install macchanger
```

### Usage

Usage is really simple, just run the following as root:

```
macchanger -r eth0
```

This changes the MAC address of your wired interface to a random value. If you use wifi, replace eth0 with wlan0 or whatever your interface is called.

There are other usage-possibilities, with the following command, you can change the MAC address to a specific value:

```
macchanger -m XX:XX:XX:XX:XX:XX
```

The other options can be found in the manpage of macchanger.

### Change MAC on every boot

If you want to run the changer on every boot, you can add a small function into /etc/rc.d. Just put a file named “change\_mac” into this directory and insert the macchanger command.

```
echo "macchanger -r eth0" > /etc/rc.d/change_mac
```

This way you get a new MAC address every boot.