8.16.2015

Kali Linux 2.0da Android Studioni o`rnatish

Buning uchun zarur bo`lgan dasturiy vositalar:
Java JDK
Android Studio

Java JDKni o`rnatish
Dastlab ushbu bog`lam orqali Java JDK yuklab olinadi. Ushbu misolda Java JDKning 8 versiyasi ko`rib o`tilgan. Yuklab olingan fayl dastlab arxivdan ochiladi:
tar -xzvf jdk-8u51-linux-x64.tar.gz
So`ngra ushbu papka /opt papkasiga ko`chiriladi:
mv jdk1.8.0_51 /opt
Quyidagi sozlashlar amalga oshiriladi:
update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_51/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_51/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.8.0_51/jre/lib/amd64/libnpjp2.so 1
update-alternatives --set java /opt/jdk1.8.0_51/bin/javaupdate-alternatives --set javac /opt/jdk1.8.0_51/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.8.0_51/jre/lib/amd64/libnpjp2.so
Ushbu sozlashlar amalga oshirilgandan so`ng, qilingan ishning to`g`ri bajarilganini tekshirib ko`rish uchun ishlab turgan Java va uning kompilyatori versiyasi tekshiriladi:
java -version
javac -version

Android SDKni o`rnatish
Navbat Andoid SDKni o`rnatishga. Dastlab ushbu bog`lam orqali Android SDK yuklab olinadi va arxivdan ochiladi va /opt papkasiga ko`chiriladi:
tar xvzf android-sdk_r24.3.3-linux.tgz 
mv android-sdk-linux /opt/
So`ngra Android SDKni o`rnatish jarayoni boshlanadi:
/opt/android-sdk-linux/tools
./android

6.12.2015

Linuxda WiFi tarqatish nuqtasini yaratish

Ishda telefonim uchun internetni WiFidan foydalanaman. Asosan o`sha siz biladigan Windowsdagi Connectify-me dasturi orqali. Linuxda (Debian) ishlagan paytlarim muammo bo`layotgandi. Mana shu dasturga Linuxda ekvivalent dasturlarni qarab chiqib hostapd dasturini tanladim va uni sozlashga ham ikki soat vaqtim ketti, albatta u-bu resurslarga qarab. Ushbu postda mana dasturni sozlashni ko`rib o`tamiz. 
Demak, hostapd va dnsmasq ni o`rnatib olamiz:
apt-get install hostapd dnsmasq
So`ngra WiFi tarqatish nuqtasining parametrlarini sozlaymiz, Buning uchun hostapd.conf ni biror tahrirlash dasturi yordamida ochamiz:
subl /etc/hostapd/hostapd.conf
Fayl tarkibiga quyidagi sozlashlarni kiritamiz:
interface=wlan0
driver=nl80211# WiFi tarqatish nuqtasining nomi
ssid=rootg# 802.11g standarti
hw_mode=g
channel=6
#WPA uchun 1, WPA2 uchun 2, WPA+WPA2 uchun 3
wpa=2
# Parol o`rnatamiz
wpa_passphrase=86543216
Agarda hostapdni ishga tushirsak WiFi nuqtasiga ulangan qurilmalar avtomatik tarzda IP ololmaydi, shuning uchun muammoni hal qilish uchun dnsmasq.conf faylida quyidagi ko`rinishdagi sozlashlarni yozamiz:

bind-interfacesinterface=wlan0# Qurilmalarga beriladigan IPlar oralig`i
dhcp-range=192.168.18.2,192.168.18.254
Endi bitta start.sh nomli shell skript fayl yaratib, wifi routerga IP berish va tarmoqdagi (eth0) internetni share qilish uning tarkibida quyidagilarni yozamiz:
#!/bin/bash
ifconfig wlan0 192.168.18.1
service dnsmasq restart
sysctl net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo hostapd /etc/hostapd/hostapd.conf
WiFi tarqatish nuqtasi tayyor!!!
sh start.sh