Ini topik lama, tapi kadang-kadang saya masih perlu membuat kabel network.
Yang saya pakai adalah : T-568B
dan kalau di test di network cable tester... tetap berurutan 1 s/d 8 normal
TIPS WEB2PY - Fast Development
Mengambil sebagian data dan paste ke form baru.
row = db((db.lease.unit == 35) & (db.lease.tenant == 27)).select(orderby=~db.lease.sewa_akhir).first()
sewa_akhir = row.sewa_akhir
tgl_masuk = row.tgl_masuk
form.vars.tgl_masuk = tgl_masuk #ini memasukkan ke fieldform
return dict(sewa_akhir=sewa_akhir,tgl_masuk=tgl_masuk)
row = db((db.lease.unit == 35) & (db.lease.tenant == 27)).select(orderby=~db.lease.sewa_akhir).first()
sewa_akhir = row.sewa_akhir
tgl_masuk = row.tgl_masuk
form.vars.tgl_masuk = tgl_masuk #ini memasukkan ke fieldform
return dict(sewa_akhir=sewa_akhir,tgl_masuk=tgl_masuk)
- Perhatikan tilde di orderby
- perhatikan .first()
di view tinggal memasukkan {{=sewa_akhir}}
Update Tanggal
query = (db.unit.id == request.vars.unit)
set = db(query).update(sewa_akhir=request.vars.sewaakhir)
Menambah hari ke sebuah tanggal
dd = (datetime.datetime.now() + datetime.timedelta(days=10)).strftime("%Y-%m-%d")
return dict(dd=dd)
kode get json
http://127.0.0.1:8000/JPM/lease/getlast.json?unit=36&tenant=28
di controller:
def getlast():
row = db((db.lease.unit == 31) & (db.lease.tenant == 23)).select(orderby=~db.lease.sewa_akhir).first()
return dict(sewa_akhir=row.sewa_akhir,sewa_awal=row.sewa_awal)
Menambah hari ke sebuah tanggal
dd = (datetime.datetime.now() + datetime.timedelta(days=10)).strftime("%Y-%m-%d")
return dict(dd=dd)
kode get json
http://127.0.0.1:8000/JPM/lease/getlast.json?unit=36&tenant=28
di controller:
def getlast():
row = db((db.lease.unit == 31) & (db.lease.tenant == 23)).select(orderby=~db.lease.sewa_akhir).first()
return dict(sewa_akhir=row.sewa_akhir,sewa_awal=row.sewa_awal)
Belajar Serat Kayu
Ini adalah hal-hal umum yang saya pelajari sewaktu membuat box kayu.
Kita harus mempelajari serat kayu dalam membuat box. Serat kayu menentukan teknik yang akan dipakai. Chipping adalah hal yang ingin di hindari. Lihat dan perhatikan arah serat kayunya.
Box dalam CNC harus benar-benar flat surface. (bagaimana cara termudah melakukannya?)
- mungkin harus di pass lewat flat bit dulu.
Mengamplas Groove itu susah apabila belum punya tehnik.
Membuat tegak lurus dan paralel adalah problem perkayuan yang paling umum. Kuasai materi ini, selanjutnya lebih mudah.
Kita harus mempelajari serat kayu dalam membuat box. Serat kayu menentukan teknik yang akan dipakai. Chipping adalah hal yang ingin di hindari. Lihat dan perhatikan arah serat kayunya.
Box dalam CNC harus benar-benar flat surface. (bagaimana cara termudah melakukannya?)
- mungkin harus di pass lewat flat bit dulu.
Mengamplas Groove itu susah apabila belum punya tehnik.
Membuat tegak lurus dan paralel adalah problem perkayuan yang paling umum. Kuasai materi ini, selanjutnya lebih mudah.
PARADIGMA PROYEK 3 HARI
Setelah melalui fase menjadi pekerja, hambatan yang paling besar dalam menuju kemajuan adalah DISTRAKSI. Di zaman penuh dengan teknologi digital ini banyak sekali yang membuat kita menjadi tidak fokus.
Kita menuju kemana? ini adalah pertanyaan yang susah dijawab apabila tidak fokus.
Saya sedang menikmati belajar kembali hal-hal yang bersifat engineering, namun dalam perjalanannya kadang tidak menemukan jawaban untuk sebuah permasalahan.
Ini perlunya pekerjaan yang berdasarkan bagian per bagian.
Kita membagi problem besar menjadi problem kecil-kecil yang dapat di pecahkan.
Disini saya tertarik pada ide paradigma proyek 3 hari.
Saya belajar dari video ini. Klik sini
https://www.youtube.com/watch?v=ohr6O78jGzs
Sangat inspiratif buat saya dan saya merasa saya dapat melakukannya.
Apa idenya?
Idenya adalah bagaimana kita belajar bagian-bagian yang kecil-kecil.
Hari pertama:
Ngoprek dan mengetes-ngetes.
Refactor (ini pelajaran pentingnya. Mengecilkan bagian sampai cukup dapat dipecahkan)
Hari kedua.
Buat semua berfungsi.
Buat semua BUGS kabur!!!
Hari ketiga.
Dokumentasi- dokumentasi
Refactor
Refactor
Blog.
Taruh di repository.
Kesalahan dalam Membuat
Ini adalah kesalahan yang kerap saya lakukan dalam MAKE something.
0. Tidak pakai Design.
1. Design awal mengalami perubahan sambil berjalan.
2. Posisi baut menabrak satu sama lain.
3. Pemotongan tidak siku.
4. Pemotongan Tidak AKURAT. (ini mengakibatkan tidak siku).
5. Redundancy Kabel kemana mana. (Mulai gunakan crimping).
6. Struktural tidak bidang segitiga (Jadi letooyy)
Favorite Making tools:
1. Alumunium siku 20x20x1.5mm x 6 meter
2. Pelat Alumunium lurus 20mmx2mm x 6 meter
3. Rivet untuk kunci 3mm
4. Bor 4.5 untuk rivet
5. Pelat aluminium lanjutan.
6. Gergaji besi elektrik
7. Bor Tangan
8. Crimping kabel
0. Tidak pakai Design.
1. Design awal mengalami perubahan sambil berjalan.
2. Posisi baut menabrak satu sama lain.
3. Pemotongan tidak siku.
4. Pemotongan Tidak AKURAT. (ini mengakibatkan tidak siku).
5. Redundancy Kabel kemana mana. (Mulai gunakan crimping).
6. Struktural tidak bidang segitiga (Jadi letooyy)
Favorite Making tools:
1. Alumunium siku 20x20x1.5mm x 6 meter
2. Pelat Alumunium lurus 20mmx2mm x 6 meter
3. Rivet untuk kunci 3mm
4. Bor 4.5 untuk rivet
5. Pelat aluminium lanjutan.
6. Gergaji besi elektrik
7. Bor Tangan
8. Crimping kabel
Install web2py di raspberry pi
Saya gunakan script ini.
copy paste.
chmod +x
lalu jalankan.
echo "This script will:
1) install all modules need to run web2py on Ubuntu/Debian
2) install web2py in /home/www-data/
3) create a self signed sll certificate
4) setup web2py with mod_wsgi
5) overwrite /etc/apache2/sites-available/default
6) restart apache.
You may want to read this script before running it.
Press a key to continue...[ctrl+C to abort]"
read CONFIRM
#!/bin/bash
# optional
# dpkg-reconfigure console-setup
# dpkg-reconfigure timezoneconf
# nano /etc/hostname
# nano /etc/network/interfaces
# nano /etc/resolv.conf
# reboot now
# ifconfig eth0
echo "installing useful packages"
echo "=========================="
apt-get update
apt-get -y install ssh
apt-get -y install zip unzip
apt-get -y install tar
apt-get -y install openssh-server
apt-get -y install build-essential
apt-get -y install python2.5
apt-get -y install ipython
apt-get -y install python-dev
apt-get -y install postgresql
apt-get -y install apache2
apt-get -y install libapache2-mod-wsgi
apt-get -y install python2.5-psycopg2
apt-get -y install postfix
apt-get -y install wget
apt-get -y install python-matplotlib
apt-get -y install python-reportlab
apt-get -y install mercurial
/etc/init.d/postgresql restart
# optional, uncomment for emacs
# apt-get -y install emacs
# optional, uncomment for backups using samba
# apt-get -y install samba
# apt-get -y install smbfs
echo "downloading, installing and starting web2py"
echo "==========================================="
cd /home
mkdir www-data
cd www-data
rm web2py_src.zip*
wget http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
mv web2py/handlers/wsgihandler.py web2py/wsgihandler.py
chown -R www-data:www-data web2py
echo "setting up apache modules"
echo "========================="
a2enmod ssl
a2enmod proxy
a2enmod proxy_http
a2enmod headers
a2enmod expires
a2enmod wsgi
mkdir /etc/apache2/ssl
echo "creating a self signed certificate"
echo "=================================="
openssl genrsa 1024 > /etc/apache2/ssl/self_signed.key
chmod 400 /etc/apache2/ssl/self_signed.key
openssl req -new -x509 -nodes -sha1 -days 365 -key /etc/apache2/ssl/self_signed.key > /etc/apache2/ssl/self_signed.cert
openssl x509 -noout -fingerprint -text < /etc/apache2/ssl/self_signed.cert > /etc/apache2/ssl/self_signed.info
echo "rewriting your apache config file to use mod_wsgi"
echo "================================================="
echo '
NameVirtualHost *:80
NameVirtualHost *:443
# If the WSGIDaemonProcess directive is specified outside of all virtual
# host containers, any WSGI application can be delegated to be run within
# that daemon process group.
# If the WSGIDaemonProcess directive is specified
# within a virtual host container, only WSGI applications associated with
# virtual hosts with the same server name as that virtual host can be
# delegated to that set of daemon processes.
WSGIDaemonProcess web2py user=www-data group=www-data processes=1 threads=1
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py
WSGIPassAuthorization On
AllowOverride None
Order Allow,Deny
Deny from all
Allow from all
AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \
/home/www-data/web2py/applications/$1/static/$2
Options -Indexes
Order Allow,Deny
Allow from all
Deny from all
Deny from all
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/self_signed.cert
SSLCertificateKeyFile /etc/apache2/ssl/self_signed.key
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py
WSGIPassAuthorization On
AllowOverride None
Order Allow,Deny
Deny from all
Allow from all
AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \
/home/www-data/web2py/applications/$1/static/$2
Options -Indexes
ExpiresActive On
ExpiresDefault "access plus 1 hour"
Order Allow,Deny
Allow from all
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
' > /etc/apache2/sites-available/default
# echo "setting up PAM"
# echo "================"
# sudo apt-get install pwauth
# sudo ln -s /etc/apache2/mods-available/authnz_external.load /etc/apache2/mods-enabled
# ln -s /etc/pam.d/apache2 /etc/pam.d/httpd
# usermod -a -G shadow www-data
echo "restarting apache"
echo "================"
/etc/init.d/apache2 restart
cd /home/www-data/web2py
sudo -u www-data python -c "from gluon.widget import console; console();"
sudo -u www-data python -c "from gluon.main import save_password; save_password(raw_input('admin password: '),443)"
echo "done!"
copy paste.
chmod +x
lalu jalankan.
echo "This script will:
1) install all modules need to run web2py on Ubuntu/Debian
2) install web2py in /home/www-data/
3) create a self signed sll certificate
4) setup web2py with mod_wsgi
5) overwrite /etc/apache2/sites-available/default
6) restart apache.
You may want to read this script before running it.
Press a key to continue...[ctrl+C to abort]"
read CONFIRM
#!/bin/bash
# optional
# dpkg-reconfigure console-setup
# dpkg-reconfigure timezoneconf
# nano /etc/hostname
# nano /etc/network/interfaces
# nano /etc/resolv.conf
# reboot now
# ifconfig eth0
echo "installing useful packages"
echo "=========================="
apt-get update
apt-get -y install ssh
apt-get -y install zip unzip
apt-get -y install tar
apt-get -y install openssh-server
apt-get -y install build-essential
apt-get -y install python2.5
apt-get -y install ipython
apt-get -y install python-dev
apt-get -y install postgresql
apt-get -y install apache2
apt-get -y install libapache2-mod-wsgi
apt-get -y install python2.5-psycopg2
apt-get -y install postfix
apt-get -y install wget
apt-get -y install python-matplotlib
apt-get -y install python-reportlab
apt-get -y install mercurial
/etc/init.d/postgresql restart
# optional, uncomment for emacs
# apt-get -y install emacs
# optional, uncomment for backups using samba
# apt-get -y install samba
# apt-get -y install smbfs
echo "downloading, installing and starting web2py"
echo "==========================================="
cd /home
mkdir www-data
cd www-data
rm web2py_src.zip*
wget http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
mv web2py/handlers/wsgihandler.py web2py/wsgihandler.py
chown -R www-data:www-data web2py
echo "setting up apache modules"
echo "========================="
a2enmod ssl
a2enmod proxy
a2enmod proxy_http
a2enmod headers
a2enmod expires
a2enmod wsgi
mkdir /etc/apache2/ssl
echo "creating a self signed certificate"
echo "=================================="
openssl genrsa 1024 > /etc/apache2/ssl/self_signed.key
chmod 400 /etc/apache2/ssl/self_signed.key
openssl req -new -x509 -nodes -sha1 -days 365 -key /etc/apache2/ssl/self_signed.key > /etc/apache2/ssl/self_signed.cert
openssl x509 -noout -fingerprint -text < /etc/apache2/ssl/self_signed.cert > /etc/apache2/ssl/self_signed.info
echo "rewriting your apache config file to use mod_wsgi"
echo "================================================="
echo '
NameVirtualHost *:80
NameVirtualHost *:443
# If the WSGIDaemonProcess directive is specified outside of all virtual
# host containers, any WSGI application can be delegated to be run within
# that daemon process group.
# If the WSGIDaemonProcess directive is specified
# within a virtual host container, only WSGI applications associated with
# virtual hosts with the same server name as that virtual host can be
# delegated to that set of daemon processes.
WSGIDaemonProcess web2py user=www-data group=www-data processes=1 threads=1
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py
WSGIPassAuthorization On
AllowOverride None
Order Allow,Deny
Deny from all
Allow from all
AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \
/home/www-data/web2py/applications/$1/static/$2
Options -Indexes
Order Allow,Deny
Allow from all
Deny from all
Deny from all
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/self_signed.cert
SSLCertificateKeyFile /etc/apache2/ssl/self_signed.key
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py
WSGIPassAuthorization On
AllowOverride None
Order Allow,Deny
Deny from all
Allow from all
AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \
/home/www-data/web2py/applications/$1/static/$2
Options -Indexes
ExpiresActive On
ExpiresDefault "access plus 1 hour"
Order Allow,Deny
Allow from all
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
' > /etc/apache2/sites-available/default
# echo "setting up PAM"
# echo "================"
# sudo apt-get install pwauth
# sudo ln -s /etc/apache2/mods-available/authnz_external.load /etc/apache2/mods-enabled
# ln -s /etc/pam.d/apache2 /etc/pam.d/httpd
# usermod -a -G shadow www-data
echo "restarting apache"
echo "================"
/etc/init.d/apache2 restart
cd /home/www-data/web2py
sudo -u www-data python -c "from gluon.widget import console; console();"
sudo -u www-data python -c "from gluon.main import save_password; save_password(raw_input('admin password: '),443)"
echo "done!"
Langganan:
Postingan (Atom)