Gentoo」カテゴリーアーカイブ

Gentoo Linuxおよび他のディストリビューションを含むLinux全般についてのカテゴリーです。

Sambaの使い方メモ

Sambaユーザーの追加

Sambaで使うユーザーを追加したい場合はsmbpasswdを使って次のように設定します。

# smbpasswd -a <username>
New SMB password: ********
Retype new SMB password: ********
Added user <username>.

<username>の部分は追加したいユーザー名に読み替えてください。

ゲストアカウントの追加

パスワードなしのゲストアカウントでログインできるようにするには以下の設定を追加します。

公開フォルダ

[public]
  comment = Public Stuff
  path = /path/to/public
  public = yes
  guest ok = yes
;  writable = yes

ゲストアカウント

[global]
  map to guest = Bad User
  guest account = nobody

シンボリックリンクを有効化

[global]allow insecure wide links = yesを追加の上、シンボリックリンクを利用したいフォルダにfollow symlinkswide linksの設定を追加してください。

[global]
  allow insecure wide links = yes
[public]
  follow symlinks = yes
  wide links = yes

Linuxでバッテリー残量の確認

バッテリー関係の情報は/sys/class/power_supplyで取得できるようです。

$ ls /sys/class/power_supply/BAT0/
alarm
capacity
capacity_level
cycle_count
device@
energy_full
energy_full_design
energy_now
manufacturer
model_name
power/
power_now
present
serial_number
status
subsystem@
technology
type
uevent
voltage_min_design
voltage_now

バッテリー残量の表示

$ cat /sys/class/power_supply/BAT0/energy_now 
47530000
$ cat /sys/class/power_supply/BAT0/energy_full
48760000
$ cat /sys/class/power_supply/BAT0/capacity
97

ツールを使って取得したい場合はacpitoolとかが使えるそうです。

Xorgでマウス移動速度の変更方法

xinputコマンドを使ってDevice Accel Constant Decelerationを変更するとマウスカーソルの移動速度を変更できるようです。

使い方

まず、マウスデバイスのIDを探します。(下の例では8

$ xinput list
⎡ Virtual core pointer              id=2
⎜   ↳ Virtual core XTEST pointer   id=4
⎜   ↳ Logitech USB Optical Mouse   id=8
⎣ Virtual core keyboard             id=3    
    ↳ Virtual core XTEST keyboard  id=5
    ↳ Power Button                 id=6

現在の設定内容を確認します。

$ xinput list-props 8
Device 'Logitech USB Optical Mouse':
  Device Enabled (137): 1
  Coordinate Transformation Matrix (139): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
  Device Accel Profile (262): 0
  Device Accel Constant Deceleration (263): 1.000000
  Device Accel Adaptive Deceleration (264): 1.000000
  Device Accel Velocity Scaling (265): 10.000000

Device Accel Constant Decelerationの設定値を変更します。

$ xinput set-prop 8 263 0.8

Device Accel Constant Decelerationに大きな値を設定するとゆっくり動き、小さな値を設定すると速く動くようです。


実行例の出力結果は今回の設定に不要な部分やスペースを省略している部分があります。