Wednesday 19 September 2018


You may require SELinux to be enabled. But if you try to test or configure new applications in your CentOS 7 operating system while SELinux is enabled, even the right configuration may not work. For example, if you have Apache web server installed, the default web root is /var/www/html. If you have SELinux enabled, and you try to change it to something else, Apache web server won’t start unless you reconfigure SELinux. In situations like this, you may want to disable SELinux temporarily. But SELinux can’t be disabled without a system reboot. You may consider changing SELinux mode to permissive. That way SELinux policy won’t be enforced, which is kind of the same as disabling SELinux. When you’re done, you can set SELinux to enforcing mode again. You can run the following command to set SELinux to permissive mode temporarily:




sudo setenforce 0






Now run the following command to check the current mode of SELinux:
sudo sestatus
As you can see in the marked section of the screenshot below, SELinux is set to permissive mode.



Wednesday 19 April 2017



Sedikit berbagi lagi mengenai beberapa tip cara mengganti nama Database SQL Server, atau jika muncul error  "The database could not be exclusively locked to perform the operation. (Microsoft SQL Server, Error: 5030)"

1.set terlebih dahulu mode database ke single user mode, dengan cara " ALTER DATABASE dbName ( database yang ingin di ganti namanya ) SET SINGLE_USER WITH ROLLBACK IMMEDIATE "

2.kemudian rename nama database tersebut " ALTER DATABASE dbName ( nama database lama ) MODIFY NAME = dbNewName ( nama Database Baru ) "

3.lalu kembalikan mode database ke Multiuser mode, dengan cara " ALTER DATABASE dbName ( Nama Database Baru ) SET MULTI_USER WITH ROLLBACK IMMEDIATE "
ya sekian yang dapat saya sharing hari ini, semoga dapat membantu

 Sharing Komputer yuk!!



Wednesday 8 March 2017


Salah Satu game populer yang sering dimainkan yaitu  Plants Vs Zombies. Game ini termasuk kategory game ringan yang dapat di gunakan pada spek komputer standar. yang dimana terdiri dari tumbuhan dan zombie, Kita sebagai pemain ditugaskan menjaga, agar zombie tersebut tidak masuk ke dalam rumah kita. Jika zombie berhasil memasuki rumah kita maka permainan selesai atau gagal. Meskipun begitu, kita masih bisa melanjutkannya dengan level yang sama. Game ini dibuat oleh developer video game Popcap dari Amerika dengan ukuran yang sangat kecil sehingga bisa digolongkan permainan yang ringan untuk komputer/laptop kita dan juga game bisa membuat kita lupa waktu setelah memainkan game ini karena keseruannya. Bagi yang sudah tidak sabaran untuk memainkan game ini Langsung saja silahkan download game Plants Vs Zombie dibawah ini.


download plants vs zombies

Petunjuk Instalasi :

1. Setelah selesai download game Plants Vs Zombies, Klik Kanan pada file game yang sudah di download, Pilih "Extract Here".



2. Jalankan gamenya dengan nama "Plants Vs Zombies - Application".

Selesai

Screenshot



 3. Jika kesulitan saat download, silahkan silahkan berkomentar di post ini.
  
4. Jika link mengalami kerusakan, silahkan berkomentar di post ini

#sumber : http://www.wendyandriyan.info
   
 Sharing Komputer yuk!!



1. Kunjungi website : http://accesstrade.co.id/register
Cara Mendaftar di Accestrade
Cara Mendaftar di Accestrade
2. Klik daftar
3. Pilih perorangan jika anda tidak punya perusahaan (untuk akun pribadi)
4. Isikan data alamat email dan pasword. Kemudian klik daftar

Cara Mendaftar di Accestrade
Cara Mendaftar di Accestrade
5. Setelah itu anda akan disuruh untuk membuka email, dan mengeklik link konfirmasi. 
6. Buka email yang anda daftarkan tadi dan klik link konfirmasinya. Kemudian ikuti petunjuk berikutnya, antara lain anda akan disuruh mengisi data pribadi, account bank dan data blog yang akan anda gunakan.

7. Selamat anda sudah sukses mendaftar di access trade cost per action indonesia

sumber : http://www.kitapunya.net/2015/05/cara-mendaftar-di-accestrade-cost-per-action.html

Mari Sharing berbagi " Sharing Komputer Yuk !"


Tuesday 28 February 2017

Yah di sela sela kesibukan gw sedikit berbagi mengenai salah satu tugas kuliah gw. Disini gw di berikan tugas membuat program bebas yang bisa upload dan membaca file. Nah kebetulan gw lagi demen demennya sama JSP jadi gw milih bahasa pemrograman JSP. Mungkin itu sedikit intro yang gak penting... hehhehe


Yup mari lanjutkan bahan bahan yang di perlukan untuk membuat program ini, yaitu :
1. Pastikan anda sudah melakukan instalasi JDK sebagai mesin untuk mengolah file Java dan Servernya, sebagai contoh kami menggunakan Apache Tomcat ( untuk cara install JDK dan Apache Tomcat akan di Bahas di Post Selanjutnya) 😋
Gambar 1 Tanda Sudah terinstal JDK
2. Setelah semua itu di install lalu coba jalankan Apache Tomcat, bisa menggunakan Netbean atau run file startup di C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin ( ini tergantung milih file locationnya, kalo defaultnya ya seperti ini )
Gambar 2 Server Tomcat Status Running
3. Create New Projeck Pada Netbean Anda, Kemudian pilih Web Application
Gambar 3 Create Projeck
4. Kemudian pilih Web Application lalu klik next
Gambar 4 Pemberian Nama Projeck Name
5. Silahkan Berikan Nama Project Name anda (terserah ), setelah itu pilih lagi Next
Gambar 5 Pemilihan Server

6. Pada Tahapan ini silahkan pilih Server yang anda inginkan, klo gw sih pilihnya Apache Tomcat #gratisan, setelah itu klik Finish Aja
7. Kemudian file pun akan terbentuk, seperti akan muncul index.jsp ( untuk netbean lama ) atau index.html (untuk netbean baru versi 8 )
8. Setelah itu pada Web Pages klik kanan > New > Folder. Fungsi ini untuk menampung sementara file yang di upload, setelah di upload lalu di baca dan kemudian di hapus kembali
Gambar 6 Pembuatan Folder


9. Masukkan Library di bawah ini, librari ini yang berfungsi untuk membaca, menulis dan mengupload file .doc; .pdf ; .text

    Gambar 7 Paket Library

    10. Lalu coba akses Akses http://localhost:8080/namaProgram misalkan disini kami menamai programnya http://localhost:8080/tugas_upload_txt_20170120/, maka akan muncul seperti pada gambar di bawah ini

    Gambar 8 Aplikasi Bisa Diakses

    11.  Lalu pilihlah File yang ingin di baca tulisannya dengan menekan tombol Choose File

     Gambar 9 Tampilan Ketika Choose File
    12. Pada Program ini Hanya file bertipe .pdf, .text, dan .doc saja yang bisa dibuka dan pada sistem ini mendeteksi jika file melebihi 3 MB, karena jika tidak di batasi akan terasa lama banget 😎

    13.  Lalu klik Upload, maka akan muncul seperti pada gambar di bawah ini
     Gambar 10 Hasil Program ketika klik upload

     Gambar 11 File yang di upload
    14. Pada system ini akan mencari kata kata yang sama di setiap katanya, jika di dalam file tidak ada kata yang sama maka system tidak akan memunculkan kata tersebut
    15. Untuk proses pembuatannya hanya terdiri dari 2 file index.jsp dan ProsessUpload.java
    index.jsp
    <%--
        Document   : index
        Created on : Jan 17, 2017, 8:40:59 PM
        Author     : RAMA
    --%>

    <%@page import="org.apache.poi.xwpf.usermodel.XWPFDocument"%>
    <%@page import="java.io.FileOutputStream"%>
    <%@page import="java.io.File"%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
            <link href="utility/css/style.css" rel="stylesheet" type="text/css">
            <script type="text/javascript" src="utility/javascript/jquery-1.10.2.min.js"></script>
            <script type="text/javascript" src="utility/javascript/jquery.form.min.js"></script>
        </head>
        <body>
            <div id="upload-wrapper">
                <div align="center">
                    <h3>Upload Text </h3>
                    <form action="ProsessUpload" name="uploadform" method="post"
                    enctype="multipart/form-data" id="MyUploadForm">
                       
                        <input name="FileInput" id="FileInput" type="file"
                               accept=".txt,application/msword,application/pdf"/>
                        <input type="submit"  id="submit-btn" value="Upload" />
                    </form>
                    <div id="progressbox" >
                        <div id="progressbar"></div ><div id="statustxt">0%</div>
                    </div>
                    <div id="output"></div>
                </div>
            </div>
           
            <script type="text/javascript">
                $(document).ready(function() {
                    var options = {
                        target:   '#output',   // respon dari server
                        beforeSubmit:  beforeSubmit,  // melakukan sesuatu sebelum di kirim
                        success:       afterSuccess,  // melakukan sesuatu sesudah di krim
                        uploadProgress: OnProgress, //upload progress
                        resetForm: true        // reset form jika berhasil di upload
                    };
            
                    $('#MyUploadForm').submit(function() {
                        $(this).ajaxSubmit(options);           
                        return false;
                    });
            
                    // function jika data success kirim
                    function afterSuccess()
                    {
                        $('#submit-btn').val("Upload");
                        $('#progressbox').delay( 1000 ).fadeOut(); //hide progress bar

                    }

                    // function sebelum di kirim
                    function beforeSubmit(){
                        //check browser support
                        if (window.File && window.FileReader && window.FileList && window.Blob)
                        {
            
                            // check jika file kosong
                            if( !$('#FileInput').val())
                            {
                                $("#output").html("File masih kosong ...");
                                return false
                            }
            
                            var fsize = $('#FileInput')[0].files[0].size; //get file size
                            var ftype = $('#FileInput')[0].files[0].type; // get file type
            
                            //type file yang di ijinkan
                            //alert(ftype);
                            switch(ftype)
                            {  
                                //case 'image/png':
                                //case 'image/gif':
                                //case 'image/jpeg':
                                //case 'image/pjpeg':
                                case 'text/plain':
                                //case 'text/html': //html file
                                //case 'application/x-zip-compressed':
                                case 'application/pdf':
                                case 'application/msword':
                                //case 'application/vnd.ms-excel':
                                //case 'application
                                //vnd.openxmlformats-officedocument.wordprocessingml.document':
                                //case 'video/mp4':
                                    break;
                                default:
                                    $("#output").html("<b>"+ftype+"</b> Maaf file tidak di dukung!");
                                    return false
                            }
            
                            //maximal file size
                            if(fsize>5242880)
                            {
                                $("#output").html("<b>"+bytesToSize(fsize) +"</b>
                               Maaf File Terlalu Besar maximal 5 MB.");
                                return false
                            }
                            // loading prosess upload      
                            $('#submit-btn').val('Uploading ...');
                            $("#output").html(""); 
        
                        }else{
                            // Output error to older unsupported browsers that doesn't support
                            // HTML5 File API
                            $("#output").html("Maaf browser anda tidak mendukung silahkan upgrade");
                            return false;
                        }
                    }

                    //progress bar function
                    function OnProgress(event, position, total, percentComplete)
                    {
                        //Progress bar
                        $('#progressbox').show();
                        $('#progressbar').width(percentComplete + '%')
                        //update progressbar percent complete
                        $('#statustxt').html(percentComplete + '%'); //update status text
                        if(percentComplete>50)
                        {
                            $('#statustxt').css('color','#000'); //change status text to white after 50%
                        }
                    }
                    function bytesToSize(bytes) {
                        var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
                        if (bytes == 0) return '0 Bytes';
                        var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
                        return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
                    }
                });

            </script>
          
        </body>

    </html>


    Kemudian buatlah servletnya dengan cara :
    1. Pada source package, klik kanan > pilih new > pilih servlet > berikan nama servlet tersebut > finish
    seperti pada gambar di bawah ini
    Gambar 12 New Servlet

     Gambar 13 Pemberian nama servlet

    Gambar 14 hasil / view tampilan servlet

    2. Kemudian ganti file seperti gambar 14 diatas, menjadi
    try {
                /* TODO output your page here. You may use following sample code. */
                boolean succesUpload = false;
                //prosess upload file
                Part filePart = request.getPart("FileInput");
                //String test = request.getParameter("test");
                String temp = filePart.getHeader("content-disposition").split(";")[2].trim();
                String filename = temp.substring("filename=\"".length(), temp.length() - 1);
                String sPath = getServletConfig().getServletContext().getRealPath("/upload");
                InputStream inputStream = filePart.getInputStream();
                String type = filePart.getContentType();
                FileOutputStream stream = new FileOutputStream(getServletContext().getRealPath("/upload") + "\\" + filename);
                int i = -1;
                while ((i = inputStream.read()) != -1) {
                    stream.write(i);
                    succesUpload = true;
                }
                stream.close();
                inputStream.close();

                if (succesUpload) {
                    //membaca file

                    FileInputStream fis = new FileInputStream(sPath + "\\" + filename);
                    Set s = new TreeSet();
                    Set dd = new TreeSet();
                    String[] stringsArray;
                    //mengecek kata-kata yang tidak boleh muncul
                    String[] listKataSama = {"", " ","”","»", "–", ".", ":", "'", "*", "<", ">", "/", "(", ")", "**", "$", "#", "!", "+", "&", "dan","biasa","dengan","serta","tetapi","namun","sedangkan","sebaliknya","melainkan","hanya","bahkan","lagipula","apalagi","jangankan","kecuali","hanya","lalu","kemudian","selanjutnya","yaitu","yakni","bahwa","adalah","ialah","jadi","karena","oleh","sebab","itu","bila","kalau","jikalau","jika","asal","agar","supaya","ketika","sewaktu","sebelum","sesudah","tatkala","sampai","hingga","sehingga","untuk","seperti","tempat", "di", "itu", "dari", "ini", "pada", "atau", "ke", "akan", "maka", "yang", "kemana", "dimana", "siapa", "mengapa", "bagaimana"};
                    Hashtable hashListKataSama = new Hashtable();
                    for (int q = 0; q < listKataSama.length; q++) {
                        //menyimpan kata-kata yang sama tersebut, jika ada kata yang sesuai di list maka tidak dimunculkan
                        hashListKataSama.put("" + listKataSama[q], false);
                    }
                    String text = "";
                    int y = 1;
                    Hashtable hashJumlahKataSama = new Hashtable();
                    Vector kataSama = new Vector();
                    if (type != null) {
                        try {
                            // cek type format dile
                            if (type.equalsIgnoreCase("application/vnd.openxmlformats-officedocument.wordprocessingml.document")) {
                                try {
    //                            XWPFDocument doc = new XWPFDocument(fis); // untuk docx
    //                            List<XWPFParagraph> paragraphs = doc.getParagraphs();
    //                            System.out.println("Total no of paragraph " + paragraphs.size());
    //                            for (XWPFParagraph para : paragraphs) {
    //                                out.println(para.getText().trim());
    //                            }
    //                            fis.close();

                                } catch (Exception exc) {
                                    out.println(exc);
                                }

                            } else if (type.equalsIgnoreCase("application/pdf")) {
                                try {
                                    PDDocument document = null;
                                    document = PDDocument.load(new File(sPath + "\\" + filename));
                                    document.getClass();
                                    //if (document.isEncrypted()) {
                                        PDFTextStripperByArea stripper = new PDFTextStripperByArea();
                                        stripper.setSortByPosition(true);
                                        stripper.setLineSeparator(".");
                                        stripper.setWordSeparator(".");
                                        PDFTextStripper Tstripper = new PDFTextStripper();
                                        String text1 = Tstripper.getText(document).trim();
                                        String textArr[]=text1.split(" ");
                                       if(textArr!=null && textArr.length>0){
                                            for(int d=0;d<textArr.length;d++){
                                            text = text + textArr[d].trim().toLowerCase().replace(".", ",") + ",";
                                        }
                                       }
                                        //out.println("Text:" + st.trim());
                                   // }
                                } catch (Exception e) {
                                    e.printStackTrace();
                                }

                            } else if (type.equalsIgnoreCase("application/msword")) {
                                try {
                                    HWPFDocument doc = new HWPFDocument(fis);
                                    WordExtractor we = new WordExtractor(doc);
                                    //get Paragraph text  as array
                                    // String papa = "";
                                    String paragraphs[] = we.getParagraphText();
                                    for (int xx = 0; xx < paragraphs.length; xx++) {
                                        //out.println(paragraphs[xx].trim()+"</br>");
                                        text = text + paragraphs[xx].trim().toLowerCase().replace(".", ",") + ",";
                                    }

                                } catch (Exception exc) {
                                    out.print(exc);
                                }
                            } else {

                                BufferedReader bufferedReader = new BufferedReader(new FileReader(sPath + "\\" + filename));
                                String text1;
                                while ((text1 = bufferedReader.readLine()) != null) {
                                    //out.println(text1.trim() + "<br>");
                                    text = text + text1.trim().toLowerCase().replace(".", ",") + ",";
                                }
                                try {
                                    if (bufferedReader != null) {
                                        bufferedReader.close();
                                    }
                                } catch (IOException ex) {
                                    ex.printStackTrace();
                                }
                            }
                        } catch (Exception exc) {
                            out.print(exc);
                        }

                        ///setelah di tampung lalu di olah
                        if (text != null && text.length() > 0) {

                            String hilangkanTanda[] = text.split("/");
                            if (hilangkanTanda.length > 0) {
                                text = "";
                            }
                            for (int w = 0; w < hilangkanTanda.length; w++) {
                                text = text + (hilangkanTanda[w].toLowerCase().replace("/", ",") + ",").trim();
                            }
                            hilangkanTanda = text.split("-");
                            if (hilangkanTanda.length > 0) {
                                text = "";
                            }
                            for (int w = 0; w < hilangkanTanda.length; w++) {
                                text = text + (hilangkanTanda[w].toLowerCase().replace("-", ",") + ",").trim();
                            }
                            hilangkanTanda = text.split(":");
                            if (hilangkanTanda.length > 0) {
                                text = "";
                            }
                            for (int w = 0; w < hilangkanTanda.length; w++) {
                                text = text + (hilangkanTanda[w].toLowerCase().replace(":", ",") + ",").trim();
                            }

                            hilangkanTanda = text.split(" ");
                            if (hilangkanTanda.length > 0) {
                                text = "";
                            }
                            for (int w = 0; w < hilangkanTanda.length; w++) {
                                text = text + (hilangkanTanda[w].toLowerCase().replace(" ", ",") + ",").trim();
                            }

                            stringsArray = text.split(",");
                            for (String a : stringsArray) {
                                if (!hashListKataSama.containsKey("" + a)) {
                                    if (!s.add(a)) {
                                        //y++;
                                        if (hashJumlahKataSama != null && hashJumlahKataSama.containsKey("" + a)) {
                                            y = (int) hashJumlahKataSama.get("" + a);
                                            hashJumlahKataSama.put("" + a, (int) y + 1);
                                        } else {
                                            y = 1;
                                            hashJumlahKataSama.put("" + a, (int) y + 1);
                                            kataSama.add("" + a);
                                        }

                                    }
                                }

                            }
                            if (kataSama != null && kataSama.size() > 0) {
                                out.println("<table>");
                                out.println("<tr>");
                                out.println("<td>No</td>");
                                out.println("<td>Nama Sama</td>");
                                out.println("<td>Jumlah</td>");
                                out.println("</tr>");

                                for (int e = 0; e < kataSama.size(); e++) {
                                    String namaSama = (String) kataSama.get(e);
                                    out.println("<tr>");
                                    out.println("<td>" + (e + 1) + "</td>");
                                    out.println("<td>" + namaSama + "</td>");
                                    out.println("<td>" + (int) hashJumlahKataSama.get("" + namaSama) + "</td>");
                                    out.println("</tr>");
                                    //out.println("<p>" + (e + 1) + ".duplicate detected : " + namaSama + "; jumlah :" + (int) hashJumlahKataSama.get("" + namaSama) + "</p>");
                                    //out.println("<p>jumlah : " + (int)hashJumlahKataSama.get(""+namaSama)+"</p>");
                                }
                                out.println("</table>");
                            }
                        }

                    }

                    //setelah di baca lalu di hapus
                    File file = new File(sPath + "\\" + filename);
                    boolean xx = file.delete();
                    if (xx) {
                        System.out.println(file.getName() + " is deleted!");
                    } else {
                        System.out.println("Delete operation is failed.");
                    }
                }
              
            } catch (Exception exc) {
                out.println(exc);
            } finally {
                out.close();
            }

    Jika ada pertanyaan bisa komentari post ini 

    "Happy Sharing Komputer "


    Iklan

    rss


    Translate

    Chat

    Komentar Blog

    Iklan