Hirdetés

Midiről vezérelhető vizuális metronóm

A kezdetek

Az alapot egy Arduino UNO szolgáltatta, ehhez vettem még midi shieldet és gombsort plusz kijelzőt.
Örömmel tapasztaltam, hogy Linuxra is van fejlesztő környezet az Arduinohoz, így nem kell Windows-zal vacakolni.
A midi shieldet, plusz a kezdeti LCD kijelzőt innen vettem.
Azért esett erre az oldalra a választás, mert itt készen van a kijelző és a shiled. Nem nagyon kell forrasztani, nekem pedig ez elég volt akkor.

Azért indult el ez a projekt, mert midiről vezérelhető digitális metronómot nem nagyon találtam készen.
Arduinora viszont létezik egy kész program, ami pont azt csinálja, ami nekem kell. Úgy gondoltam, jó lesz kiindulási alapnak. :)

Az első eredmény

Nem is csalódtam! Amint megérkezett a shield és a kijelző kombó, megírtam életem első Arduino programját C++-ban! És láss csodát, működött!
Sőt, át tudtam alakítani a gites programot úgy, hogy a shielddel és a kijelzővel működjön.

Audio-GD nfb 5.32 DAC "tuning"

Fontos!! Ezeket a műveleteket utánam csinálni, mindenkinek a saját felelőssége. Semmire nem vállalok garanciát!

Miért írtam meg ezt a cikket?

A válasz egyszerű: Ezen a típuson, ilyen jellegű módosításról leírást, sehol nem találtam a neten. Ezért úgy gondoltam, ha már úgyis megcsinálom írok róla pár szót, hátha ezzel segíthetek másoknak!

Mit tartalmaz a cikk?

Az Audio-GD nfb 5.32 DAC tuningját. Igazából annyira nem nevezném tuningnak, inkább a régebbi alkatrészek, gyári, modernebb alkatrészekre való cseréjének.

Milyen alkatrészeket cserélek ki?

Az USB32 chip-et egy gyári a boltban kapható elvileg szebben szóló XMOS U8-ra.

Mit építsek ebből? (itx alaplap)

A kérdés adott, vázolom hozzá a sztorit.

Van egy régebbi projektből megmaradt itx alaplapom rammal, integrált AMD cpu-val.
Amit nem akarok építeni:
- HTPC (mer már van egy média lejátszóm és elégedett vagyok vele)
- NAS (ez is van és szintén elégedett vagyok vele)

Amit szeretek az a zene, sokat hallgatok zenét, erősítőm is van.

A kérdés adott mit építsek ebből a lapból? Nem muszáj zenével kapcsolatosnak lennie, csak azért írtam fentebb hátha támpontként szolgál valakinek.
Eladni nem szeretném, nem éri meg. Inkább megtartanám, de az se jó, hogy csak áll a polcon.

Igazából végső elkeseredésemben írom ezt. :F Hátha valakinek van valami ötlete amit hajlandó megosztani, és hátha nekem is bejön. :)

Android app futtatása linux-on ARChon segítségével

Sziasztok!

Az alábbi blog bejegyzésben azt mutatom be, hogy kell linuxon android appot futtatni.
Nekem igazából egy apphoz kellett azzal működik..

1. Telepítsük a google chrome-ot

2. Töltsük le az archon-t.
32bit: https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1-x86_32.zip
64bit: https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1-x86_64.zip

3. csomagoljuk ki valahova

4. Menjünk a Bővítmények menübe

5. Kapcsoljuk be a fejlesztői módot

6. tallózzuk be bővítményként azt a mappát amit az előbb kicsomagoltunk

7. Telepítsük az android eszközünkre az ARChon Packager-t a play áruházból

8. Nyissuk meg

9. Nyomjuk a NEXT-re

10. Válasszuk az Installed application majd NEXT

11. Válasszuk ki a PC-n futtatni kívánt alkalmazást majd NEXT

Mindenes home server okosan

Mi az írás célja?

Iránymutatást adni, hogy lehet olyan rendszert építeni, ami kiváltja a routert, a NAS-t és talán a médiaboxot is.

Mi nem célja az írásnak?

Elmerülni az alapokban, és belemenni a részletekbe.

Kinek szól az írás?

Azoknak, akik már haladóbb szinten ismerik a linuxot. Vagyis nem néznek furán, ha azt mondom, hogy rsync, vagy mount. :)

Bevezetés

Többször olvastam itt a PH!-n, hogy a "mindent egybe és fogyasszon minél kevesebbet" mozgalom tagjai szeretnének egy olyan PC-t, ami egyszerre router, NAS és médialejátszó. Nekem ez annyira nem tetszett, mert nem véletlenül vannak erre célhardverek és szoftverek, külön-külön, amik a problémát sokkal egyszerűbben oldják meg.

[home server projekt] készen venni vagy építeni?

Van egy PC és server alkatrészekből összelegózott NAS-om. Ez már nem is hobbi, hanem hivatás. Lehet jobban jártam volna, ha veszek egy gen8-as microservert?
Azt tudom, hogy mitől lennék boldog. Ha egy fájl másolásnál nem lenne a load az egekben, és lenne egy itx ház ami kb microserver méretű.

Hozzá hasonló házat keresek, max 10-15 eFt-ért, magam legyártani nem szeretném, ha valaki elkészíti nekem ennyiért az is jó lehet.

iStarUSA S-35

Egyszerűen kezelhető, stabil webes felületű, kis erőforrás igényű linux os-t keresek. Tud valaki ilyet?

[home server projekt] Wifi AP

Nos, az igaz, hogy ez a cikk az előzőeknél korábban jelenik meg. De nemsokára itt a karácsony és ez az én ajándékom. :))

Gondolkodtam, hogy miről írhatnék, ami ideális "ajándék" lenne. Ekkor jutott eszembe a wifi AP történet. Azért választottam ezt, mert réges-régen amikor az ubuntu 14.04 még gondolat sem volt, sokan küzdöttek azzal, hogy a server-ükből AP-t csináljanak.

Kerestem és rájöttem, hogy ennél mi sem egyszerűbb. Ahhoz, hogy az adapter wifi "router-ként" működjön, az kell, hogy támogassa az AP (master) módot. Nyilván kell megfelelő driver is, érdemes valami támogatottabb típust beszerezni.

Ha meg akarjuk nézni, hogy az adapter tudja e az AP módot, tegyük fel az iw nevű programot, és keressük az AP, VLAN/AP kulcsszavakat.

Itt egy rövidke leírás a beállításról. Én nem csináltam végig minden lépést, mivel a DHCP server a Zentyal-ban benne van. De gondolom működik.

[home server projekt] RAID Manager (MegaCLI)

Ehhez nem fűznék sok kommentárt, a RAID kártyához használom.
Két változó van amit módosítani kell, az egyik a MegaCLI program helye, a másik az ENCLOSURE változó.

FORRÁS

MegaCLI managelő szkript.

#!/bin/bash
#
# Calomel.org
# https://calomel.org/megacli_lsi_commands.html
# LSI MegaRaid CLI
# lsi.sh @ Version 0.05
#
# description: MegaCLI script to configure and monitor LSI raid cards.

# Full path to the MegaRaid CLI binary
MegaCli="/usr/local/sbin/MegaCli64"

# The identifying number of the enclosure. Default for our systems is "8". Use
# "MegaCli64 -PDlist -a0 | grep "Enclosure Device"" to see what your number
# is and set this variable.
ENCLOSURE="8"

if [ $# -eq 0 ]
then
echo ""
echo " OBPG .:. lsi.sh $arg1 $arg2"
echo "-----------------------------------------------------"
echo "status = Status of Virtual drives (volumes)"
echo "drives = Status of hard drives"
echo "ident \$slot = Blink light on drive (need slot number)"
echo "good \$slot = Simply makes the slot \"Unconfigured(good)\" (need slot number)"
echo "replace \$slot = Replace \"Unconfigured(bad)\" drive (need slot number)"
echo "progress = Status of drive rebuild"
echo "errors = Show drive errors which are non-zero"
echo "bat = Battery health and capacity"
echo "batrelearn = Force BBU re-learn cycle"
echo "logs = Print card logs"
echo "checkNemail = Check volume(s) and send email on raid errors"
echo "allinfo = Print out all settings and information about the card"
echo "settime = Set the raid card's time to the current system time"
echo "setdefaults = Set preferred default settings for new raid setup"
echo ""
exit
fi

# General status of all RAID virtual disks or volumes and if PATROL disk check
# is running.
if [ $1 = "status" ]
then
$MegaCli -LDInfo -Lall -aALL -NoLog
echo "###############################################"
$MegaCli -AdpPR -Info -aALL -NoLog
echo "###############################################"
$MegaCli -LDCC -ShowProg -LALL -aALL -NoLog
exit
fi

# Shows the state of all drives and if they are online, unconfigured or missing.
if [ $1 = "drives" ]
then
$MegaCli -PDlist -aALL -NoLog | egrep 'Slot|state' | awk '/Slot/{if (x)print x;x="";}{x=(!x)?$0:x" -"$0;}END{print x;}' | sed 's/Firmware state://g'
exit
fi

# Use to blink the light on the slot in question. Hit enter again to turn the blinking light off.
if [ $1 = "ident" ]
then
$MegaCli -PdLocate -start -physdrv[$ENCLOSURE:$2] -a0 -NoLog
logger "`hostname` - identifying enclosure $ENCLOSURE, drive $2 "
read -p "Press [Enter] key to turn off light..."
$MegaCli -PdLocate -stop -physdrv[$ENCLOSURE:$2] -a0 -NoLog
exit
fi

# When a new drive is inserted it might have old RAID headers on it. This
# method simply removes old RAID configs from the drive in the slot and make
# the drive "good." Basically, Unconfigured(bad) to Unconfigured(good). We use
# this method on our FreeBSD ZFS machines before the drive is added back into
# the zfs pool.
if [ $1 = "good" ]
then
# set Unconfigured(bad) to Unconfigured(good)
$MegaCli -PDMakeGood -PhysDrv[$ENCLOSURE:$2] -a0 -NoLog
# clear 'Foreign' flag or invalid raid header on replacement drive
$MegaCli -CfgForeign -Clear -aALL -NoLog
exit
fi

# Use to diagnose bad drives. When no errors are shown only the slot numbers
# will print out. If a drive(s) has an error you will see the number of errors
# under the slot number. At this point you can decided to replace the flaky
# drive. Bad drives might not fail right away and will slow down your raid with
# read/write retries or corrupt data.
if [ $1 = "errors" ]
then
echo "Slot Number: 0"; $MegaCli -PDlist -aALL -NoLog | egrep -i 'error|fail|slot' | egrep -v '0'
exit
fi

# status of the battery and the amount of charge. Without a working Battery
# Backup Unit (BBU) most of the LSI read/write caching will be disabled
# automatically. You want caching for speed so make sure the battery is ok.
if [ $1 = "bat" ]
then
$MegaCli -AdpBbuCmd -aAll -NoLog
exit
fi

# Force a Battery Backup Unit (BBU) re-learn cycle. This will discharge the
# lithium BBU unit and recharge it. This check might take a few hours and you
# will want to always run this in off hours. LSI suggests a battery relearn
# monthly or so. We actually run it every three(3) months by way of a cron job.
# Understand if your "Current Cache Policy" is set to "No Write Cache if Bad
# BBU" then write-cache will be disabled during this check. This means writes
# to the raid will be VERY slow at about 1/10th normal speed. NOTE: if the
# battery is new (new bats should charge for a few hours before they register)
# or if the BBU comes up and says it has no charge try powering off the machine
# and restart it. This will force the LSI card to re-evaluate the BBU. Silly
# but it works.
if [ $1 = "batrelearn" ]
then
$MegaCli -AdpBbuCmd -BbuLearn -aALL -NoLog
exit
fi

# Use to replace a drive. You need the slot number and may want to use the
# "drives" method to show which drive in a slot is "Unconfigured(bad)". Once
# the new drive is in the slot and spun up this method will bring the drive
# online, clear any foreign raid headers from the replacement drive and set the
# drive as a hot spare. We will also tell the card to start rebuilding if it
# does not start automatically. The raid should start rebuilding right away
# either way. NOTE: if you pass a slot number which is already part of the raid
# by mistake the LSI raid card is smart enough to just error out and _NOT_
# destroy the raid drive, thankfully.
if [ $1 = "replace" ]
then
logger "`hostname` - REPLACE enclosure $ENCLOSURE, drive $2 "
# set Unconfigured(bad) to Unconfigured(good)
$MegaCli -PDMakeGood -PhysDrv[$ENCLOSURE:$2] -a0 -NoLog
# clear 'Foreign' flag or invalid raid header on replacement drive
$MegaCli -CfgForeign -Clear -aALL -NoLog
# set drive as hot spare
$MegaCli -PDHSP -Set -PhysDrv [$ENCLOSURE:$2] -a0 -NoLog
# show rebuild progress on replacement drive just to make sure it starts
$MegaCli -PDRbld -ShowProg -PhysDrv [$ENCLOSURE:$2] -a0 -NoLog
exit
fi

# Print all the logs from the LSI raid card. You can grep on the output.
if [ $1 = "logs" ]
then
$MegaCli -FwTermLog -Dsply -aALL -NoLog
exit
fi

# Use to query the RAID card and find the drive which is rebuilding. The script
# will then query the rebuilding drive to see what percentage it is rebuilt and
# how much time it has taken so far. You can then guess-ti-mate the
# completion time.
if [ $1 = "progress" ]
then
DRIVE=`$MegaCli -PDlist -aALL -NoLog | egrep 'Slot|state' | awk '/Slot/{if (x)print x;x="";}{x=(!x)?$0:x" -"$0;}END{print x;}' | sed 's/Firmware state://g' | egrep build | awk '{print $3}'`
$MegaCli -PDRbld -ShowProg -PhysDrv [$ENCLOSURE:$DRIVE] -a0 -NoLog
exit
fi

# Use to check the status of the raid. If the raid is degraded or faulty the
# script will send email to the address in the $EMAIL variable. We normally add
# this method to a cron job to be run every few hours so we are notified of any
# issues.
if [ $1 = "checkNemail" ]
then
EMAIL="raidadmin@localhost"

# Check if raid is in good condition
STATUS=`$MegaCli -LDInfo -Lall -aALL -NoLog | egrep -i 'fail|degrad|error'`

# On bad raid status send email with basic drive information
if [ "$STATUS" ]; then
$MegaCli -PDlist -aALL -NoLog | egrep 'Slot|state' | awk '/Slot/{if (x)print x;x="";}{x=(!x)?$0:x" -"$0;}END{print x;}' | sed 's/Firmware state://g' | mail -s `hostname`' - RAID Notification' $EMAIL
fi
fi

# Use to print all information about the LSI raid card. Check default options,
# firmware version (FW Package Build), battery back-up unit presence, installed
# cache memory and the capabilities of the adapter. Pipe to grep to find the
# term you need.
if [ $1 = "allinfo" ]
then
$MegaCli -AdpAllInfo -aAll -NoLog
exit
fi

# Update the LSI card's time with the current operating system time. You may
# want to setup a cron job to call this method once a day or whenever you
# think the raid card's time might drift too much.
if [ $1 = "settime" ]
then
$MegaCli -AdpGetTime -aALL -NoLog
$MegaCli -AdpSetTime `date +%Y%m%d` `date +%H:%M:%S` -aALL -NoLog
$MegaCli -AdpGetTime -aALL -NoLog
exit
fi

# These are the defaults we like to use on the hundreds of raids we manage. You
# will want to go through each option here and make sure you want to use them
# too. These options are for speed optimization, build rate tweaks and PATROL
# options. When setting up a new machine we simply execute the "setdefaults"
# method and the raid is configured. You can use this on live raids too.
if [ $1 = "setdefaults" ]
then
# Read Cache enabled specifies that all reads are buffered in cache memory.
$MegaCli -LDSetProp -Cached -LAll -aAll -NoLog
# Adaptive Read-Ahead if the controller receives several requests to sequential sectors
$MegaCli -LDSetProp ADRA -LALL -aALL -NoLog
# Hard Disk cache policy enabled allowing the drive to use internal caching too
$MegaCli -LDSetProp EnDskCache -LAll -aAll -NoLog
# Write-Back cache enabled
$MegaCli -LDSetProp WB -LALL -aALL -NoLog
# Continue booting with data stuck in cache. Set Boot with Pinned Cache Enabled.
$MegaCli -AdpSetProp -BootWithPinnedCache -1 -aALL -NoLog
# PATROL run every 672 hours or monthly (RAID6 77TB @60% rebuild takes 21 hours)
$MegaCli -AdpPR -SetDelay 672 -aALL -NoLog
# Check Consistency every 672 hours or monthly
$MegaCli -AdpCcSched -SetDelay 672 -aALL -NoLog
# Enable autobuild when a new Unconfigured(good) drive is inserted or set to hot spare
$MegaCli -AdpAutoRbld -Enbl -a0 -NoLog
# RAID rebuild rate to 60% (build quick before another failure)
$MegaCli -AdpSetProp \{RebuildRate -60\} -aALL -NoLog
# RAID check consistency rate to 60% (fast parity checks)
$MegaCli -AdpSetProp \{CCRate -60\} -aALL -NoLog
# Enable Native Command Queue (NCQ) on all drives
$MegaCli -AdpSetProp NCQEnbl -aAll -NoLog
# Sound alarm disabled (server room is too loud anyways)
$MegaCli -AdpSetProp AlarmDsbl -aALL -NoLog
# Use write-back cache mode even if BBU is bad. Make sure your machine is on UPS too.
$MegaCli -LDSetProp CachedBadBBU -LAll -aAll -NoLog
# Disable auto learn BBU check which can severely affect raid speeds
OUTBBU=$(mktemp /tmp/output.XXXXXXXXXX)
echo "autoLearnMode=1" > $OUTBBU
$MegaCli -AdpBbuCmd -SetBbuProperties -f $OUTBBU -a0 -NoLog
rm -rf $OUTBBU
exit
fi

### EOF ###

[home server projekt] Az OS

Ez az írás csupán tájékoztató jellegű, hogy én mit választottam. Az én ízlésemet tükrözi, semmi mást. Mindenkinek és minden célra megfelelő OS nincs, én így döntöttem, lehet te másképp fogsz.

Mikor elkezdtem megépíteni a servert, arra gondoltam, hogy a router-t és a nas-t össze lehetne vonni. Korábban írtam, hogy nem szeretem az ilyen öszvér megoldásokat, de vonzott a kihívás, úgyhogy belevágtam a keresésbe.

Első körben virtuális gépen teszteltem az OS-eket. Azt tudtam, hogy linux lesz a kiválasztott, mivel az ingyenes. Csak azt nem tudtam, hogy milyen.
Kipróbáltam az Open Wrt-től kezdve a NAS OS-eken át, az általános OS-ekig mindent. És arra jutottam, hogy Zentyal lesz a befutó.

Előnye, hogy kis vállaltokhoz fejlesztett rendszer, könnyű kezelhetőséggel, és szép webes felülettel.
Hátránya, hogy a webes felület tényleg csak a legszükségesebbeket tudja. Ami nekem kell, dhcp, dns, tűzfal. Vagyis a NAS részét konzolból kell managelni.
Gondolkodtam még egy ubuntu szerver + webmin kombón is, de a zentyal szerintem egyszerűbb és szintúgy ubuntu alapokon nyugszik.

[home server projekt] pci-e -> usb 3.0 -> mini pci-e riser

Igaz nem teljesen mai a történet, de leírom. Adott egy alaplap aminek van mini pci-e portja. Hogy csinálok ebből PCI-E-t? Hát riserrel! :) Nézegettem a risereket, de olyan esetlennek tűntek, és még drágák is voltak. Ami tetszett, az kb 20k volt, ennyit szerintem nem éri meg rá áldozni. Megláttam ebay-en egy olyan risert amit bányászáshoz használnak. Gondolom sokan ismerik, PCI-E x1-ből csinál PCI-E x16-ot, egy USB 3.0 kábel segítésével. Az ára sem vészes. De mi lenne ha az x1-es PCI-E véget lecserélném egy mini pci-e foglalatra aminek szintén usb 3.0 vége van. Na ilyet nem találtam elsőre, de nagy nehezen sikerült ráakadni..

RISER

Ez ok, de ennek a bemenete mini usb 3.0. Mi?? Ilyen kábel Magyarországon gyakorlatilag nem létezik. :D Úgyhogy ismét ebay-hez nyúltam.