Saturday, August 5, 2017

Kicad: create single layer pcb

Flow to create single layer pcb:
  1. Create schematic diagram using Eeschema
  2. Run PvPCB to associate components and footprint
  3. Generate netlist
  4. Run Pcbnew to layout pcb
After running Pcbnew, spread all component with following steps:
  1. Read netlist
  2. Activate Mode footprint: manual and automatic movement and placement
  3. Right click -> Global spread and place
Change default track size and distance
  1. Design Rules -> Design Rules
  2. Set Clearence: default distance between track and other components or track.
  3. Set Track width: default track width/size
Layer setup
  1. Design Rules -> Layers Setup
  2. Set F for front and B for back, with each side F and B.
    1. F: CrtYd, Fab and SilkS
    2. B: Mask, SilkS and Adhes
  • Solder Mask (F/B Mask):These define the solder masks. All pads should appear on one of these layers (SMT) or both (for through hole) to prevent the varnish from covering the pads.
  • Silk Screen (F/B SilkS):They are the layers where the drawings of the components appear. That’s where you draw things like component polarity, first pin indicator, reference for mounting, …
  • Solder Paste (F/B Paste):Used to produce a mask to allow solder paste to be placed on the pads of surface mount components, generally before reflow soldering. Usually only surface mount pads occupy these layers.
  • Adhesive (F/B Adhes):These are used in the application of adhesive to stick SMD components to the circuit board, generally before wave soldering.
  • Fabrication (F/B Fab):Footprint assembly (?).
  • Courtyard (F/B CrtYd):Used to show how much space a component physically takes on the PCB.

Thursday, July 20, 2017

Alur pindah sekolah SD 2017 (1 Propinsi/DKI)

Alur proses yang dapat dilakukan orang tua dalam mengurus pindah sekolah (mutasi) SD adalah sebagai berikut:
  1. Mendapatkan Surat Keterangan Telah Diterima dari sekolah yang dituju.
  2. Mengurus perpindahan sekolah disekolah lama dengan dokumen antara lain:
    1. Surat Keterangan Telah Diterima.
    2. Surat permohonan mutasi yang ditandatangani diatas meterai 6.000,-.
  3. Minta persetujuan dari Dinas Pendidikan Kecamatan dengan dokumen antara lain:
    1. Form 8355.
    2. Copy Akreditasi sekolah lama.
    3. Copy ijin operasional sekolah lama. 
    4. Surat Keterangan Kelakukan Baik dari sekolah lama.
    5. NISN (Nomor Induk Siswa Nasional).
    6. Keterangan pindah yang ada dibagian akhir rapot.
    7. Surat Keterangan Telah Diterima (dari no 2).
    8. Surat permohonan mutasi yang ditandatangi diatas meterai 6.000,- (dari no 2).
  4. Setelah mendapat persetujuan pada no 3 (telah ditandatang dan distempel), copy semua dokumen yang disertakan pada no.3 sebanyak 2 rangkap (1 untuk dokumen dan 1 untuk Sudin Walikota. Selanjutnya, minta persetujuan dari Dinas Pendidikan Sudin Walikota dengan dokumen asli dan copynya.
  5. Bawa berkas pada No. 4 kesekolah tujuan.
Catatan: proses no 3 & 4 membutuhkan waktu 1 hari ± 3jam.

    Tuesday, June 20, 2017

    What do we have to prepare before upload in Amazon

    Create these your application icon for various dimension in png format:
    1. Small icon 114 x 114px PNG (with transparency)
    2. Large icon 512 x 512px PNG (with transparency)
    Promotional image (Recommended) 1024 x 500px (landscape only) PNG or JPG
    Create 3 Screen shoot 800X480 or 480x800.

    Sunday, June 11, 2017

    What do we have to prepare before upload our application in Google Play Store

    Create your application icon in 512x512 px. in Android Studio, use Image Asset to generate application icon (include for Google Play Store) 

    Google play publishing a new application, from dashboarrd
    1. Set privacy policy (url, privacy policy must image)
    2. App access
    3. Ads
    4. Content rating
    5. Target audience
    6. News apps
    7. Data safety
    8. Government apps
    9. Financial features
    10. Health
    11. Select an app category and provide contact details
    12. Set up your store listing (Store presence -> Main store lisiting)
    13. Select countries and regions
    14. Create closed & Open testing release (the same version)
    15. Create a new release
    16. Preview and confirm the release
    17. Send the release to Google for review

    Store presence -> Main store lisiting
    1. App name
    2. Short description
    3. Full description
    4. App icon
    5. Feature graphic demension 1024 w x 500 h in JPG or 24-bit PNG (no alpha
    6. Phone screenshots (8 images)

    https://developer.android.com/distribute/console

    Friday, May 26, 2017

    Blocking IP by country for some ports using ipset

    To block IP by country, we need IP blocks for particular country. This step needs IP blocks from http://ipdeny.com/.
    We need to convert IP blocks into ipset format, this bash script will do:
    1. Download block ip by country from http://www.ipdeny.com
    2. Convert block ip into ipset format
    For IPV4: http://www.ipdeny.com/ipblocks/data/countries/ For IPV6: http://www.ipdeny.com/ipv6/ipaddresses/blocks/
    Here is bash script blockcountryip.sh or download from https://garasiku.web.id/ipset/blockcountryip.sh.txt:
    #!/bin/bash
    # 2017-05-23

    if [ "$1" != "" ]; then
     echo $1
     # download ipv4 block
     echo "Download ipv4 $1"
     wget http://www.ipdeny.com/ipblocks/data/countries/$1.zone -O zone.ipv4.$1
     # download ipv6 block
     echo "Download ipv6 $1"
     wget http://www.ipdeny.com/ipv6/ipaddresses/blocks/$1.zone -O zone.ipv6.$1
     mfile1="./zone.ipv4.$1"
     ofile1="./ipv4.ipset.$1"
     touch $ofile1
     echo "creating ipset rules $ofile1 for ipv4"
     echo "create ipv4_$1 hash:net" > $ofile1
     while read line; do
      echo "add ipv4_$1 $line" >> $ofile1
     done <"$mfile1"
     echo "Done creating $ofile1"
     mfile2="./zone.ipv6.$1"
     ofile2="./ipv6.ipset.$1"
     echo "creating ipset rules $ofile2 for ipv6"
     echo "create ipv6_$1 hash:net" > $ofile2
     while read line; do
      echo "add ipv6_$1 $line" >> $ofile2
     done <"$mfile2"
     echo "Done creating $ofile2"
    else
     echo "Usage .//blockcountryip.sh countrycode2"
    fi
    To use this bash script:
    # ./blockcountryip.sh [countrycode]
    for example to generate IP blocks for China CN
    # ./blockcountryip.sh cn
    Note: you can download IP block for China from this http://garasiku.web.id/ipset/ipv4.ipset.cn with some additional IP block.
    To load it in memory
    # ipset restore -! < ipv4.ipset.[countrycode]
    [countrycode] is 2 character country code https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
    To apply in iptables
    # iptables -A INPUT -p tcp -m multiport --dports [any port you wish] -m set --match-set ipv4_[countrycode] src -j DROP
    For example to block all IPV4 from China for port 21, 22, 80, 443 and 2222
    # iptables -A INPUT -p tcp -m multiport --dports 21,22,80,443,2222 -m set --match-set ipv4_cn src -j DROP 
    # iptables -A INPUT -p udp -m multiport --dports 22,2222 -m set --match-set ipv4_cn src -j DROP
    Who will care if I block all of their connection:
    # iptables -A INPUT -m set --match-set ipv4_cn src -j DROP
    To make it persistent, follow your distribution guide how to load ipset and iptables rules every time system start/restart or network start/restart.
    Not Working IPV6
    Note:
    1. Tunneling SSH may used UDP protocol
    2. Proftpd listen on port 2222
    3. Port 25 uses to communicate with/to other mail server
    My github.com: https://github.com/dedetok/bash-block-ip-by-country
     References: