Planet of LUGoNS

milobit$MFTMirr does not match $MFT (record 0).

root@quorra:~# mount /dev/sda3 /mnt/disk
$MFTMirr does not match $MFT (record 0).
Failed to mount ‘/dev/sda3′: Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it’s a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the ‘dmraid’ documentation
for more details.
root@quorra:~#

Jedno od mogućih rešenja za ovaj problem je da se uradi kako se u poruci kaže, pokrenuti smopuiM i koristiti NTFS alat koji je u ponudi. Ali savršeno rešenje za Linuks korisnike je da koristite ntfsprogs. :o

root@quorra:~# apt-get install ntfsprogs

root@quorra:~# ntfsfix /dev/sda3
Mounting volume… $MFTMirr does not match $MFT (record 0).
FAILED
Attempting to correct errors…
Processing $MFT and $MFTMirr…
Reading $MFT… OK
Reading $MFTMirr… OK
Comparing $MFTMirr to $MFT… FAILED
Correcting differences in $MFTMirr record 0…OK
Correcting differences in $MFTMirr record 1…OK
Correcting differences in $MFTMirr record 2…OK
Correcting differences in $MFTMirr record 3…OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition… OK
Going to empty the journal ($LogFile)… OK
NTFS volume version is 3.1.
NTFS partition /dev/sda3 was processed successfully.

milobitvsftpd konfiguracija za virtualne korisnike sa piši/čitaj/briši pravima

# VSFTPD.CONF for virtual users with write/read/delete permissions
listen=YES
anonymous_enable=YES
anon_root=/srv/ftp/
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
message_file=.message
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=ftp
chmod_enable=YES
chown_upload_mode=0644
anon_umask=022
file_open_mode=0644
nopriv_user=ftp
ftpd_banner=Welcome to LUGoNS BarCamp FTP service.
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem

milobitGentoo – Kako isključiti bluetooth pri startovanju sistema na thinkpad x220

blackpearl ~ # cat /etc/local.d/bluetooth.start
#!/bin/bash
# Bluetooth disable script

/etc/init.d/bluetooth stop > /dev/null
echo disabled > /proc/acpi/ibm/bluetooth
echo “Bluetooth disabled”
blackpearl ~ #

blackpearl ~ # chmod 744 /etc/local.d/bluetooth.start

milobitKako instalirati VMware Tools na Debian Squeeze-u

root@sparrow:~# apt-get install binutils cpp gcc make psmisc linux-headers-$(uname -r)
root@sparrow:~# mount /dev/cdrom /mnt
root@sparrow:~# tar -C /tmp -zxvf /mnt/VMwareTools-8.3.2-257589.tar.gz
root@sparrow:~# umount /mnt
root@sparrow:~# cd /tmp/vmware-tools-distrib
root@sparrow:/tmp/vmware-tools-distrib# ./vmware-install.pl

milobitKako instalirati VMware Tools na Gentoo-u

tron ~ # mount /dev/cdrom /mnt
tron ~ # tar -C /tmp -zxvf /mnt/VMwareTools-8.3.2-257589.tar.gz
tron ~ # umount /mnt
tron ~ # cd /tmp/vmware-tools-distrib
tron vmware-tools-distrib# mkdir /etc/init.d/rc{0,1,2,3,4,5,6}.d
tron vmware-tools-distrib# ./vmware-install.pl
tron vmware-tools-distrib # rc-update add vmware-tools default

milobitLinksys WRT160NL unbricking pomoću serijskog priključka ( Silicon Labs CP2101 USB to UART Bridge Controller)

Šta raditi kada vaš WRT160NL posle ažuriranja firmware-a ne daje više nikakve znake života? Bez panike, ipak postoji moćnost da vaš ruter vratite u život. Ta mogućnost zove se unbricking. WRT160NL kao i većna uređaja na matičnoj ploči ima serijsku priključnicu. Da bi došli do nje moraćete da otvorite kućište rutera kako bi mogli da dođete do matične ploče. Morate znati da otvaranjem rutera gubite garanciju!!!
Većinu važnih stvari o ovom ruteru možete pročitati na openwrt.org.

Potrebne utenzilije:
- USB serial Convertor (Silicon Labs CP2101 USB to UART Bridge Controller

- WRT160NL i pinovi

- Minicom
- atftp

Silicon Labs CP2101 USB to UART Bridge Controller
cp2101

WRT160NL – i serijski port

pin function
1 3.3V
2 TX
3 RX
4 NC
5 GND

Pinovi na usb adapteru

usb_pin

Pinovi na ploci

wrt160nl_pin

wrt160nl

Kernel

— USB Serial Converter support
[*] USB Serial Console device support
<M>   USB CP210x family of UART Bridge Controllers

/var/log/massages

Dec 15 18:36:57 blackpearl kernel: [ 539.876413] usb 1-1.2: Manufacturer: Silicon Labs
Dec 15 18:36:57 blackpearl kernel: [ 539.876414] usb 1-1.2: SerialNumber: 0001
Dec 15 18:36:57 blackpearl kernel: [ 539.888954] usbcore: registered new interface driver cp210x
Dec 15 18:36:57 blackpearl kernel: [ 539.888968] usbserial: USB Serial support registered for cp210x
Dec 15 18:36:57 blackpearl kernel: [ 539.888995] cp210x 1-1.2:1.0: cp210x converter detected
Dec 15 18:36:57 blackpearl kernel: [ 539.961414] usb 1-1.2: reset full-speed USB device number 6 using ehci_hcd
Dec 15 18:36:57 blackpearl kernel: [ 540.047792] usb 1-1.2: cp210x converter now attached to ttyUSB0

 

Minicom

Minicom konfiguracija

A – Serial Device : /dev/ttyUSB0
B – Lockfile Location : /var/lock
C – Callin Program :
D – Callout Program :
E – Bps/Par/Bits : 115200 8N1
F – Hardware Flow Control : No
G – Software Flow Control : No

U-Boot

U-Boot 1.1.6 (Apr 14 2010 – 14:02:36)

DRAM: ar7100_ddr_initial_config(237) enter!
ar7100_ddr_initial_config(269) exit!

U-Boot 1.1.6 (Apr 14 2010 – 14:02:36)

AP81 (ar7100) U-boot
sri
32 MB
WRT160NL u-boot version: 1.0.0
Top of RAM usable for U-Boot at: 82000000
Reserving 279k for U-Boot at: 81fb8000
Reserving 192k for malloc() at: 81f88000
Reserving 44 Bytes for Board Info at: 81f87fd4
Reserving 36 Bytes for Global Data at: 81f87fb0
Reserving 128k for boot params() at: 81f67fb0
Stack Pointer at: 81f67f98
Now running in RAM – U-Boot at: 81fb8000
id read 0x100000ff
flash size 8MB, sector count = 128
Flash: 8 MB
*** Warning – bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: ag7100_enet_initialize…
ag7100 get ethaddr for device eth0
Fetching MAC Address from 0x81feb1e0

——–***** Get the RTL8306SD Manufactory ID=379c *****——-
Reg6: speed=0 nway=1 duplex=0
Reg5: speed=0 nway=0 duplex=0
Reg1: a1=7fd9 a2=30e0 a3=15ac a4=30e0 a5=0
Reg1: a1=7fd9 a2=30e0 a3=15ac a4=30e0
Reg1: a1=7fd9 a2=30e0 a3=15ac a4=30e0
Reg1: a1=7fd9 a2=30e0 a3=15ac a4=30e0
Reg1: a1=7fd9 a2=30e0 a3=15ac a4=30e0
eth0: 58:6d:8f:45:d6:c5
eth0 up
eth0
### main_loop entered: bootdelay=1

Hit any key to stop autoboot: 1
0
ar7100>

Konfiguracija

ar7100> printenv
bootargs=console=ttyS0,115200 root=31:04 rootfstype=squashfs init=/sbin/init mt6
mfgboot=tftp 0×81800000 mfg.bin
bootcmd=bootwrt 0xbf040020
bootdelay=1
baudrate=115200
ethaddr=0×00:0xaa:0xbb:0xcc:0xdd:0xee
ipaddr=192.168.1.1
serverip=192.168.1.254
stdin=serial
stdout=serial
stderr=serial
ethact=eth0

Environment size: 394/65532 bytes
ar7100>

blackpearl openwrt # wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/openwrt-ar71xx-wrt160nl-squashfs-sysupgrade.bin

blackpearl openwrt # mv openwrt-ar71xx-wrt160nl-squashfs-sysupgrade.bin code.bin

blackpearl openwrt # ifconfig eth0 192.168.1.254

ar7100> ping 192.168.1.254
check link duplex:Full/speed:100
Using eth0 device
host 192.168.1.254 is alive
ar7100>

ar7100> upgrade code.bin
check link duplex:Full/speed:100
Tftpd start listening on port[69]!
Load address: 0×80060000

blackpearl openwrt # atftp
tftp> connect 192.168.1.1
tftp> put code.bin

ar7100> upgrade code.bin
check link duplex:Full/speed:100
Tftpd start listening on port[69]!
Load address: 0×80060000
Receiving firmware [code.bin] from [192.168.1.254]
Write File : CODE.BIN
#

Current Code Pattern:NL16 , Upgrade Code Pattern:NL16

Code Pattern is correct!
###############################################
###############################################
###############################################
###############################################
###############################################
###############################################
###############################################
###############################################
###############################################
##########################################
done
Bytes transferred = 3276832 (320020 hex)
load addr= 0x80060000
boot file= CODE.BIN
NetBootFileXferSize= 00320020
Erase linux kernel block !!
From bf040000 To bf7dffff
Erase Flash from 0xbf040000 to 0xbf7dffff in Bank # 1
First 0x4 last 0x7d sector size 0x10000
125
Erased 122 sectors
Programming.........
Copy to Flash... write addr: bf040000
done
ar7100>

ar7100> reboot

Info: http://wiki.openwrt.org/toh/linksys/wrt160nl

milobitRaspberryPI

blackpearl # wget http://downloads.raspberrypi.org/images/raspbian/2012-10-28-wheezy-raspbian/2012-10-28-wheezy-raspbian.zip

blackpearl # sha1sum 2012-10-28-wheezy-raspbian.zip
3ee33a94079de631dee606aebd655664035756be 2012-10-28-wheezy-raspbian.zip
blackpearl #

blackpearl # unzip 2012-10-28-wheezy-raspbian.zip

blackpearl # dd bs=4M if=/home/milobit/malina/2012-10-28-wheezy-raspbian.img of=/dev/mmcblk0
462+1 records in
462+1 records out
1939865600 bytes (1.9 GB) copied, 76.0644 s, 25.5 MB/s
blackpearl #

Info: www.raspberrypi.org

milobitKako instalirati Oracle Javu na Ubuntu 12.04 LTS

blackpearl ~ $ sudo add-apt-repository ppa:webupd8team/java
blackpearl ~ $ sudo apt-get update
blackpearl ~ $ sudo apt-get install oracle-java7-installer

milobitNTFS-3G

NTFS-3G je open source implementacija NTFS fajl sistema sa podrškom za čitanje i pisanje. NTFS-3G koristi FUSE fajl sistem interfejs i licenciran je pod GNU General Public License.

Instalacija

blackpearl / # emerge -av sys-fs/ntfs3g

Konfiguracija Kernela

FUSE podrška mora biti uključena u Kernelu.

Linux Kernel Configuration: NTFS-3G kernel configuration
File systems —>
FUSE (Filesystem in Userspace) support

Mount

blackpearl / # ntfs-3g /dev/sdc /mnt/flash/

U /var/log/massages stoji da je ntfs usb ključ uspešno montiran na sistem i to sa pravima čitanja i pisanja:

Oct 11 16:50:00 blackpearl ntfs-3g[7137]: Version 2012.1.15 external FUSE 29
Oct 11 16:50:00 blackpearl ntfs-3g[7137]: Mounted /dev/sdc (Read-Write, label “”, NTFS 3.1)
Oct 11 16:50:00 blackpearl ntfs-3g[7137]: Cmdline options:
Oct 11 16:50:00 blackpearl ntfs-3g[7137]: Mount options: allow_other,nonempty,relatime,fsname=/dev/sdc,blkdev,blksize=4096
Oct 11 16:50:00 blackpearl ntfs-3g[7137]: Ownership and permissions disabled, configuration type 7

milobitMapiranje tastera volume i mute pomoću xbindkeys

Lenovo Thinkpad x220 na kome je instaliran Gentoo ne prepoznaje tastere za kontrolu tona, međutim ACPI event lepo vidi ove tastere:

Oct 09 22:25:59 blackpearl milobit: ACPI event unhandled: button/volumeup VOLUP 00000080 00000000 K
Oct 09 22:26:03 blackpearl milobit: ACPI event unhandled: button/volumedown VOLDN 00000080 00000000 K
Oct 09 22:26:05 blackpearl milobit: ACPI event unhandled: button/mute MUTE 00000080 00000000 K

Da bi kontrola tona radila i preko tastera potrebno je da instaliramo xbindkeys i da definisemo VOLUP, VOLDN i MUTE.

Instalacija xbindkeys

Xbindkeys je program koji nam omogućava da definišemo kombinacije tastera na tastaturi sa određenim komandama, ključevima ili kombinacije tastera na tastaturi.

blackpearl ~ # emerge -av  xbindkeys

U home direktorijumu potrebno je ubaciti tastere koje hoćemo da mapiramo i koju funkciju treba da obavljaju.

milobit@blackpearl ~ $ vim .xbindkeysrc

Kako treba da izgleda .xbindkeysrc

#increase volume
“amixer sset Master playback 2+”
m:0×0 + c:123
XF86AudioRaiseVolume
#decrase volume
“amixer sset Master playback 2-”
m:0×0 + c:122
XF86AudioLowerVolume
# Toggle mute
“amixer sset Master toggle”
m:0×0 + c:121
XF86AudioMute

Kada smo upisali konfiguraciju ostalo nam je samo još da učitamo ovu konfiguraciju.

milobit@blackpearl ~ $ xbindkeys

WindowMaker autostart

Da bi kontrola zvuka bila aktivna pri svakom novom startovanju wmaker-a potrebno je xbindkeys ubaciti u autostart.

milobit@blackpearl ~ $ vim /home/milobit/GNUstep/Library/WindowMaker/autostart

i ubaciti sledeću komandu:

# xbindkeys for volume and mute button
/usr/bin/xbindkeys

Footnotes