SmoothScrollMouse

Posted by Bl4ckB0y On 16.02 0 comments

agar scrollmouse pada jendela lebih halus kita dapat memperkecil rasio pergeseran
caranya....buka notepad, dan ketikan kode berikut :
=================================================================================
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\]
"SmoothScroll"=hex:01,00,00,00

=================================================================================
simpan dengan nama apapun.reg, dan filetype allfile, buka dari eksplorer dan klik 2 kali file tersebut, jawab setiap pertanyaan yang muncul dengan yes....

Ubah Theme Microsoft

Posted by Bl4ckB0y On 15.59 0 comments

Mengubah Microsoft theme merupakan hal krusial, namun apasalahnya jikak di coba
berikut caranya..............buka notepad dan masukan kode berikut
============================================================================
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Plus!\Themes\Apply]
"Screen saver"="1"
"Sound events"="1"
"Mouse pointers"="1"
"Desktop wallpaper"="1"
"Icons"="1"
"Colors"="1"
"Font names and styles"="1"
"Font and window sizes"="1"
"Rotate theme monthly"="1"
==============================================================================
simpan dengan nama apapun.reg, seperti biasa pilih allfile pada file-type-nya
lalu buka dari eksplorer, kemudian klik 2 kali file apapun.reg jawab pertanyaan yang muncul dengan yes...

MetallicLogon

Posted by Bl4ckB0y On 15.56 0 comments

dengan registry kita dapat membuat logon Windows berubah menjadi Metallic..begini caranya....buka notepad dan masukan kode berikut..
=================================================================
Windows Registry Editor Version 5.00

[HKEY_USERS\.DEFAULT\Software\microsoft\WIndows\ThemeManager\]
"ColorName"="Metallic"
==================================================================
simpan dengan nama apapun.reg, untuk file type all file lalu buka di eksplorer dan
klik 2 kali...jawab setiap pertnyaan yang muncul dengan yes..

Materi Excell

Posted by Bl4ckB0y On 15.55 0 comments

ini saya ambil dari http://yohana.ppkia.ac.id/?p=57
semoga bermanfaat...
Alamat Absolut Dalam Rumus

Alamat Absolut adalah Alamat sel atau range yang selalu merujuk pada satu tempat .pada penulisan absolut selalu ditambahkan tanda “$” pada nama kolom dan nama barisnya, sebagai contoh penulisan alamat sel “A1” adalah alamat sel relatif, sedangkan penulisan alamat sel “$A$1” adalah alamat absolut.

Fungsi Logika, teks, Tanggal dan Waktu

Beberapa fungsi logika antaralain:
Fungsi Not, And, OR dan If
Dalam menggunakan fungsi logika kita memerlukan operator pembanding

Operator pembanding yang kita gunakan adalah :
Operator Keterangan dan Contoh
= Sama dengan
> Lebih Besar
< Lebih Kecil
>= Lebih Besar atau sama dengan
<= Lebih Kecil atau sama dengan
<> Tidak sama

Fungsi Teks dipakai untuk mengolah atau memanipulasi data teks
Beberapa fungsi teks yang sering di pakai :
- fungsi Left
dipakai untuk mengambil sebagian isi teks di mulai dari sebelah kiri.
- fungsi Right
dipakai untuk mengambil sebagian isi teks di mulai dari sebelah kanan.
- Fungsi Mid
Dipakai untuk mengambil sebagian isi teks dari tengah
- Fungsi Len
Untuk menghitung jumlah karakter dalam bentuk teks.
- Fungsi lower
Untuk mengubah semua hurup dalam teks menjadi hurup Kecil.
- Fungsi Upper
Untuk mengubah semua hurup dalam teks menjadi hurup besar
- Fungsi Trim
Menghapus semua spasi pada teks
Fungsi Tanggal dan Waktu
Dipakai untuk mengolah atau memanipulasi data tanggal dan waktu.
- Fungsi date
- Fungsi today
- Fungsi time

Fungsi Vlookup
Digunakan untuk mencari suatu nilai pada kolom paling kiri suatu tabel dan mengambil nilai kolom lain yang di tentukan pada baris yang sama
Bentuk penulisan dari vlookup:
=vlookup(nilai yang dicari;nama tabel;rangelookup)

Fungsi Hlookup
Digunakan untuk mencari suatu nilai pada Baris paling kiri suatu tabel dan mengambil nilai kolom lain yang di tentukan pada baris yang sama
Bentuk penulisan dari hlookup:
=Hlookup(nilai yang dicari;nama tabel;rangelookup)

Grafik

Grafik biasa digunakan untuk menampilkan komposisi data secara visual, menggunakan gambar atau simbol tertentu sehingga mempermudah pemahaman dan pengertian tentang data secara menyeluruh.

Membuat grafik

Langkah – langkah membuat grafik :
- dari menu insert, pilih chart atu klik icon chart wizard.
- Tentukan pilihan grafik
- Tentukan range data
- Menentukan judul grafik.

Ubah IconSize

Posted by Bl4ckB0y On 15.45 0 comments

dalam registry Windows kita dapat mengubah IconSize system...
caranya...buka notepad dan ketikan kode dibawah ini...
===================================================================
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\Dekstop\WindowMetrics\]
"Shell Icon Size"="32"
===================================================================
simpan dengan nama apasaja.reg, gunakan notepad untuk membuat
lalu setelah itu dari eksplorer klik 2 kali file apasaja.reg
lalu jawab semua pertanyaan dengan yes

Enable DVD WMP

Posted by Bl4ckB0y On 15.36 0 comments

fungsi berikut ini adalah untuk melakukan Enable pada Windows Media Player untuk memutar DVD...
===================================================================
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\Setting\]
"EnableDVDUI"="yes"
===================================================================
simpan dengan nama apasaja.reg, gunakan notepad untuk membuat
lalu setelah itu dari eksplorer klik 2 kali file apasaja.reg
lalu jawab semua pertanyaan dengan yes

mengubah Kedalaman Icon Color

Posted by Bl4ckB0y On 23.34 0 comments

dengan memanfaatkan registry, kita bisa mengubah kedalaman color windows.....
berikut alamatnya...
================================================================
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\Dekstop\WindowMetrics\]

"Shell Icon BPP"="32"
================================================================

copy paste source diatas dalam notepad simpan dengan nama apapun.reg, lalu buka dari explorer dan klik 2 kali. jawab setiap pertanyaan dengan yes..

Pesan Daemon

Posted by Bl4ckB0y On 23.13 2 comments

ada sebuah problem seperti ini :
buatlah sebuah daemon yang membaca isi sebuah file. dimana tiap kali beberapa saat daemon akan menampilkan isi file tersebut, baik sudah expired atau update....


#include "sys/types.h"

#include "sys/stat.h"

#include "fcntl.h"
#include "stdio.h"
#include "stdlib.h"
void makeChild();

int main(){
if(fork()==0){
makeChild();
}
return(0);
}



void makeChild(){
FILE *p;
char string;
setsid();

umask(0);

chdir("/");
for(;;){
if((p=fopen("/home/huda/Documents/sumber.txt","r"))==NULL){
/*sumber filenya bisa diubah-ubah koq tergantung kebutuhan untuk, aku lebih suka di simpan di /home/huda/Documents/sumber.txt */
printf("File gagal dibuka\n\n");
return;
}
while((string=fgetc(p))!=EOF){
printf("%c",string);

}
fclose(p);
sleep(10); //menunggu selama 10 detik (delay)
}
}

Balada kbhit

Posted by Bl4ckB0y On 23.03 2 comments

haha....judulnya aneh ya, namun itu yang terjadi ada sebuah soal begini :
buatlah sebuah daemon yang dapat mengunci terminal setiap waktu tertentu. jika dalam waktu yang telah ditentukan user tidak menginput apapun di terminal maka, daemon akan menampilkan sebuah dialog untuk meminta password....

#include "sys/types.h"
#include "sys/stat.h"
#include "stdio.h"
#include "stdlib.h"
#include "fcntl.h"
#include "errno.h"
#include "unistd.h"
#include "syslog.h"
#include "string.h"
#include "signal.h"

#include "string.h"

#include "termios.h"





int main() {
pid_t pid, sid, gpid;

char pass[20], password[20]="huda";
/*passwordnya "huda" kalo mau diganti silakan...*/
pid = fork();
gpid=getpid();
if (0 > pid) {
exit(-1);
}
else if (pid > 0) {
exit(EXIT_SUCCESS);
}

umask(0);
system("clear");

sid = setsid();
if ( 0 > sid ) {
exit(EXIT_FAILURE);
}

if (0 > (chdir("/")) ) {
exit(EXIT_FAILURE);
}
int y=0;
while (1) {
y++; //ini counter untuk mendelay waktu keluarnya password
if(kbhit())y=0;
if(y>20000){
printf("Masukkan password: ");
fflush(stdin);
scanf("%s", &pass);
printf("\nIsi pass= %s \n", pass);
if(strcmp(pass,password)==0){
fflush(stdout);
printf("Password Benar\n");
y=0;

}else{
printf("Password Salah!!\n");
printf("Daemon masih berjalan\n");
}

}
}
exit(EXIT_SUCCESS);
}



int kbhit(void)

{

/*ini dapat sari dodot gak tau dapat dari mana,
udah aku edit biar hanya mendeteksi keyboard sekali ketik....*/

struct termios oldt, newt;

int ch;

int oldf;



tcgetattr(STDIN_FILENO, &oldt);

newt = oldt;

newt.c_lflag &= ~(ICANON | ECHO);

tcsetattr(STDIN_FILENO, TCSANOW, &newt);

oldf = fcntl(STDIN_FILENO, F_GETFL, 0);

fcntl(STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK);
ch=EOF; //tambahan dari saya, ini yang bikin selelu looping terus.

ch = getchar();

tcsetattr(STDIN_FILENO, TCSANOW, &oldt);

fcntl(STDIN_FILENO, F_SETFL, oldf);

if(ch != EOF)

{
ch=EOF; // ch kembali di buat clear

ungetc(ch, stdin);

return 1;

}

return 0;

}

Main Shell Script

Posted by Bl4ckB0y On 18.06 0 comments

ada sebuah persoalann sebagai berikut sebuah :
buatlah sebuah shell script yang dapat melakukan hal berikut :
input sebuah file txt
aku makan nasi
aku minum air
aku makan daging

program akan memotong tiap baris dari file dengan memotong beberapa karakter dari karakter ke m sampai ke n lalu hasilnya digabung dibagain bawah menjadi satu kalimat yang dipisah oleh spasi
misal input 6 sampai 8
hasilnya :
aku an nasi
aku um air
aku an daging
mak min mak
=================================================================================================

echo -n "Masukan Awal : "
read awal
echo -n "Masukan Akhir : "
read akhir
if [ $awal -gt $akhir ];
then
echo "Astagfirrullah !!!!"
exit 0
fi;
echo -n "Masukan Path File : "
read fill
baru=""
count=$(cut -c $awal-$akhir $fill | wc -l)
counter=1
while [ $counter -le $count ];
do
dua=$(cut -c $awal-$akhir $fill | head -$counter | tail -1 )
if [ $counter -eq 1 ];
then
hurufsatu=$(echo $dua | cut -c 1 | tr [[:lower:]] [[:upper:]])
dua=$(echo $dua | cut -c 2-)
dua=$hurufsatu$dua
fi;
baru="$baru $dua"
let counter=$counter+1
done

counter=1
let awal=$awal-1
let akhir=$akhir+1
while [ $counter -le $count ];
do
satu=$(cut -c -$awal $fill | head -$counter | tail -1)
dua=$(cut -c $akhir- $fill | head -$counter | tail -1 )
fbaru="$satu$dua"
if [ $counter -eq 1 ];
then echo $fbaru > metal2
else echo $fbaru >> metal2
fi;
let counter=$counter+1
done
echo $baru>>metal2

========================================================================================
compile dengan menggunakan chmod+777 dan jalankan

Upload JavaScript di Friendster

Posted by Bl4ckB0y On 04.58 1 comments

memasukan file berekstensi .js memang kadang berbahaya, namun apa salahnya kalau dicoba, berikut ini tahap-tahap buat memasukan file Javascript di Friendster.

1 . kita harus punya dulu file Javascript yang akan dimasukan. bisa membuat sendiri atau mencari di internet, kalau mau cari di Internet situs http://www.dynamicdrive.com/ cukup kompatible dengan Friendster
2. copy file script javascript yang tersedia di kotak. dan simpan dengan nama file .js
3. untuk mengupload file kunjugi http://www.fileave.com/ disini kita harus mendaftar dulu, atau bisa juga ditempat lain.
4. setelah itu masuk ke friendster teman-teman dan buka bagian edit profile..
masukan code ini :
(script languange="javascript" src="")(/script)

Contoh :
(script languange="javascript" src="http://chya_only_one.fileave.com/huda/coba.js")(/script)
ganti tanda () sama <>
begitulah dengan demikian file javascript sudah terupload, file ini bisa dibuat untuk memasukan virus, trijan atau apapun, kadang-kadang programmer jahat memasukanya untuk kepeluan keuntungan.
kalau teman-teman mau tahu gimana caranya buat javascript berbahaya, silakan aja di googling...
Insya Allah kapan-kapan tak kasih tau....

Ackerman

Posted by Bl4ckB0y On 04.47 1 comments

Ackerman merupakan sebuah program yang mengimplementasikan fungsi rekursif.....
yang mana ia akan memiliki 3 fungsi .......

/*
This program use to implement Ackerman function
With : a(m,n)------>return(a((m-1),a(m,n-1)))
a(0,n)------>return(n+1)
a(n,0)------>return(a(m-1,1))
Author : huda
e-mail : huda890@gmail.com
*/
/*iporting Input and Output Standart from java*/
import java.io.*;
/*declaration of ackerman class*/
class ackerman
{
/*declaration of main methode*/
public static void main(String args[]) throws IOException
{
/*build object of ackerman class*/
ackerman fungsi=new ackerman();
/*make object for input from console*/
BufferedReader input=new BufferedReader(new
InputStreamReader(System.in));
int m,n;
String temporary;
System.out.println("Ackerman");
System.out.println("a(m,n)------>a((m-1),a(m,n-1))");
System.out.println("a(0,n)------>n+1");
System.out.println("a(n,0)------>a(m-1,1)");
System.out.print("insert value of M:");
/*read string from console*/
temporary=input.readLine();
/*convert string to integer*/
m=Integer.parseInt(temporary);
System.out.print("insert value of N:");
/*read input from console */
temporary=input.readLine();
/*convert from string to integer*/
n=Integer.parseInt(temporary);
/*call ackerman function*/
int result=fungsi.ackerman(m,n);
/*print to console the result*/
System.out.println(result);
}
/*ackerman methode */
int ackerman(int m, int n)
{
int result;
if(m==0 && n!=0)
{return(n+1);}
else
if (n==0 && m!=0)
{
result=ackerman(m-1,1);
/*return the result */
return(resultl);
}
else
if (m!=0 && n!=0)
{
result=ackerman(m,n-1); /*found the result of first function */
/*the result of the first function used to found the second result */
result=ackerman(m-1,result); /*found the final result*/
/*return the result*/
return(hasil);
}
else /*result 1 if n=0 and m=0*/
return(1);
}
}

GCD = FPB

Posted by Bl4ckB0y On 04.44 0 comments

GCD atau FPB adalah faktor persekutuan terbesar dari dua angka atau lebih. berikut ini source code untuk mencari sebuah FPB dari dua buah angka.....

/*
This class implement of GCD
We recommended you to using Jcreator pro v3.0
Author : huda
e-mail : huda890@gmail.com
*/
import java.io.*;
class gcd
{
public static void main(String args[])throws IOException
{
String temporary;
/*first number*/
int first_number;
/*second number*/
int second_number;
/*build object of gcd class*/
gcd number=new gcd();
/*build for input from konsole*/
BufferedReader input = new BufferedReader(new
InputStreamReader(System.in));
System.out.println("GCD");
System.out.print("insert first number : ");
/*read string from console*/
temporary=input.readLine();
/*convert from temporary to integer and save to first_number*/
first_number=Integer.parseInt(temporary);
System.out.print("insert second number : ");
/*read string from console*/
temporary=input.readLine();
/*convert from temporary to integer and save to first_number*/
second_number=Integer.parseInt(temporary);
/*choose the proses*/
if(first_number>second_number)
number.proses(second_number,first_number);
/*if second number more less than first number*/
else
number.proses(first_number,second_number);
/*if second number more big than first number*/
}
/*the methode for found the gcd*/
int proses(int first,int second)
{
/*pivot is the temporary variable */
int pivot;
if(first!=0)
{
pivot=second;
second=first;
first=pivot%first;
/*recurtion function*/
return(proses(first,second));
}
/*print the gcd to console*/
System.out.println("GCD : "+second);
return(0);
}
}

Stack

Posted by Bl4ckB0y On 04.39 0 comments

Stack merupakan sebuah Struktur data yang dapat dibayangkan sebagai sebuah tumpukan (stack = tumpukan). contoh stack dalam kehidupan sehari-hari adalah sebuah tumpukan piring, dimana setiap kali piring terakhir yang kita tumpuk akan diambil terlebih dahulu. sifat stack adalah LIFO (last In forst out) --> artinya setiap data yang masuk terakhir kali akan keluar pertama kali....
berikut ini adalah source code implementasi dari sebuah stack....

/*
This Program Implemet about stack
Author : huda
e-mail : huda890@gmail.com
*/
import java.io.*;
class stack
{
static int MAXIMUMSTACK=10;
public static void main(String args[])throws IOException
{
stack s=new stack(); //build stack class
char temporary_character; //as temporary variabel to save char
String temporary_string; //temporary variabel for casting
int Choose; //this for choose
boolean flag=true; //flag for looping
int top=-1; //pointer of stack
char stack[]=new char[MAXIMUMSTACK]; //build stack object
int long_character=0; //show length of stack
/*make the buffer for input from console*/
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
/*main program*/
System.out.println("Stack");
System.out.print("insert String : ");
/*get char from console one by one */
while((temporary_character=(char)in.read())!='\n')
{
top++;
stack[top]=temporary_character;
}
top--; //character '\n' not use, so it must be pop
/*to show what user want*/
do
{
System.out.println("1.Pop 2.push 3.Print 4.exit");
System.out.print(“Inser your Choose:”);
/*because switch just use for primitif tipe, the string must be convert ot integer*/
temporary_string=in.readLine();
Choose=Integer.parseInt(temporary_string);
/*choosing*/
switch(Choose)
{
case 1: int y=s.pop(stack,top);top=y;break;
/*int y for save the value from return of pop*/
case 2: int x=s.push(stack,top);top=x;break;
/*integer x for save the return from push*/
case 3: s.Print(stack,top);break;
/*for print all data in the stack*/
case 4: flag=false;break;
/*Close porgram */
default : System.out.println("Wrong");
}
}while (flag);
}
/*for check Full stack*/
boolean full(int top)
{
if(top==MAXIMUMSTACK-1) //check stack full or not
return(true); //true if full
return (false); //otherwise false
}
/*for check the stack empty or not */
boolean empty(int top)
{
if(0>top) //check empty or not
return(true); //true if empty
return(false); //otherwise false
}
/*this function to push character*/
int push(char stack[],int top) throws IOException
{
if(!full(top)) //check stack full or not before pushing
{
char character;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Insert A Char : ");
character=(char) br.read(); //get char from console
stack[++top]=character;
/*if stack not full push wil progress*/
return(top);
/*return for x variabel*/
}
else
System.out.println("\nFull");
return(top);
/*return variabel to X*/
}
/*this methode to pop a character*/
int pop(char stack[], int top)
{
if ( empty(top)) //chaeck stack empty or not
{
System.out.println("Empty");
return(top); //return top for y variabel
}
else
{
System.out.println("Character : "+ stack[top]+" pop Succesfull");
return(--top); //return top for y variabel
}
}
/*print stack to console*/
void Print(char stack[], int top)
{
System.out.print("Stack is : ");
/*print all element to console from behind to top, (without pop proses) */
for (int i=0;top=>i;i++)
System.out.print(stack[i]);
System.out.println();
}
}

LinkedList

Posted by Bl4ckB0y On 04.37 0 comments

LinkedList merupakan sebuah struktur data yang mirip dengan Array akan tetapi Linkedlist memiliki perbedaan. Array berupa sebuah larik yang statis, yang mana jika kita memesan 10 lokasi memori kita akan diberi 10 lokasi memori, namun pada kenyataanya kadang-kadang kita membutuhkan lebih dari 10 lokasi memori, sehingga kita harus mengubah source code untuk menambah jumlah memori pada pesanan array source code kita...berbeda dengan linkedlist, walaupun tidak berurutan, linkedlist memilki kelebihan sifatnya yang dinamis membuat kita bebas dalam mengalokasikan memori, sebagai contoh saat kita bisa memesan 10 memori atau 1 memori saja tanpa merubah source code kita. kelebihan array dibanding linkedllist, array memilki data yang terurut sehingga mudah diakses, dan pengaturanya, namun memilki kekurangan pada jumlah memoriya yang statis, sedangkan linkedlist sulit dalam pengaksesanya namun fleksible dalam mengalokasikan memori....

berikut ini adalh contoh linkedlist dalam pemrograman java....

/*
This program Implement about Linked List
Include program
RemoveFirst RemoveLast AddFirst Addlast
InsertAfter InsertBefore Display Find
Author : huda
e-mail : huda890@gmail.com
*/
/*this class implement Node from a linked list*/
public class Node {
int Volume;
Node next;
public Node()
{
Volume=0;
Node next=null;
}
public void displayNode() {
System.out.println(Volume);
}
}
/*this class handle of clas Node*/
import java.io.*;
public class LinkedList {
public Node head;
private Node tail;
private Node cursor;
private Node Help;
/*this methode used to display volume of Node*/
public void Display()
{
cursor=head;
while(cursor!=null)
{
System.out.println("("+cursor.Volume+")");
cursor=cursor.next;
}
}
/*this is constructor*/
public LinkedList() {
head=null;
tail=null;
cursor=null;
Help=null;
}
/*this methode used for check the LinkedList Empty or Not*/
public boolean Empty()
{
if(head==null)
return(true);
return(false);
}
/*this methode used for find the volume of Node*/
public int find(int object)
{
int flag=1;
cursor=head;
while(cursor.Volume!=object && cursor.next!=null)
{
cursor=cursor.next;
flag++;
}
if(cursor.Volume!=object && cursor.next==null)
{
System.out.println("Not Found !!");
return(1);
}
else
{
System.out.println("Found In Index "+flag);
flag=-1;
}
return(flag);
}
/*this methode used for Add Node to the last Node*/
public Node AddLast(int object)
{
Node New_Node=new Node();
New_Node.Volume=object;
if(head==null)
{
head=New_Node;
tail=New_Node;
}
else
{
tail.next=New_Node;
tail=New_Node;
}
return(head);
}
/*this methode used to Add to first element of Linked List*/
public Node AddFirst(int object)
{
Node New_Node=new Node();
New_Node.Volume=object;
if(head==null)
{
head=New_Node;
tail=New_Node;
}
else
{
Help=head;
head=New_Node;
New_Node.next=Help;
}
return(head);
}
/*this methode used to remove first element of Linked List*/
public Node RemoveFirst()
{
if(Empty())
{
System.out.println("Empty!! !!");
return(null);
}
else
{
Help=head;
head=head.next;
Help.next=null;
}
return(head);
}
/*this methode used for remove the Last Element of LinkedList*/
public Node RemoveLast()
{
cursor=head;
if(Empty())
{
System.out.println("Empty!! !!");
return(null);
}
else
{
if(cursor.next==null)
RemoveFirst();
else
{
while(cursor.next.next!=null)
{
cursor=cursor.next;
}
cursor.next=null;
tail=null;
tail=cursor;
}
}
return(head);
}
/*this methode used to Remove the specific Node from the LinkedList*/
public Node RemoveKey(int object)
{
cursor=head;
if(Empty())
{
System.out.println("Empty!!");
return(null);
}
else
{
if(cursor.Volume==object)
RemoveFirst();
else
{
while(cursor.next.Volume!=object)
{
cursor=cursor.next;
}
if(cursor.next.next==null)
RemoveLast();
else
{
Help=cursor.next.next;
cursor.next.next=null;
cursor.next=Help;
}
}
}
return(Help);
}
/*this methode used to Insert a Node between two Node after specific Node*/
public Node InsertAfter(int Sort) throws IOException
{
cursor=head;
if(head==null)
{
System.out.println("Empty!!!");
return(null);
}
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Insert Volume :");
String temporary=input.readLine();
int object=Integer.parseInt(temporary);
int y=find(Sort);
if(y!=-1)
{
System.out.println("Not Found");
}
else
{
while(cursor.Volume!=Sort && cursor.next!=null)
{
cursor=cursor.next;
}
if(cursor.next==null)
{
AddLast(object);
}
else
{
Node New_Node=new Node();
New_Node.Volume=object;
Help=cursor.next;
cursor.next=New_Node;
New_Node.next=Help;
}
}
return(null);
}
/*this methode used to Insert a Node between two Node after specific Node*/
public Node InsertBefore(int Sort) throws IOException
{
if(head==null)
{
System.out.println("Empty!!!");
return(null);
}
int y=find(Sort);
if(y!=-1)
{
System.out.println("Not Found");
return(null);
}
cursor=head;
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Insert Volume :");
String temporary=input.readLine();
int object=Integer.parseInt(temporary);
Node New_Node=new Node();
New_Node.Volume=object;
if(head.Volume = = Sort)
{
AddFirst(object);
}
else
{
while(cursor.next.Volume!=Sort && cursor.next.next!=null)
{
cursor=cursor.next;
}
Help=cursor.next;
cursor.next=New_Node;
New_Node.next=Help;
}
return(null);
}
}
/*this clas the main class to handle second class*/
import java.io.*;
class main
{
public static void main(String[] args) throws IOException
{
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
Node node = new Node();
LinkedList list=new LinkedList();
int Answer=1;
while(Answer = =1)
{
System.out.println("Choose the methode :");
System.out.println("1.AddFirst");
System.out.println("2.AddLast");
System.out.println("3.Find");
System.out.println("4.RemoveFirst");
System.out.println("5.RemoveLast");
System.out.println("6.RemoveKey");
System.out.println("7.InsertAfter");
System.out.println("8.InsertBefore");
System.out.println("9.Display");
System.out.println("10.exit");
System.out.print("insert your choose :");
String temporary=input.readLine();
int choosen=Integer.parseInt(temporary);
switch(choosen)
{
case 1 : System.out.print("Insert Number :");
temporary=input.readLine();
choosen=Integer.parseInt(temporary);
list.AddFirst(choosen);break;
case 2 : System.out.print("Insert Number :");
temporary=input.readLine();
choosen=Integer.parseInt(temporary);
list.AddLast(choosen);break;
case 3 : list.Display();
System.out.print("Insert the Volume you want display:");
temporary=input.readLine();
choosen=Integer.parseInt(temporary);
list.find(choosen);break;
case 4 : list.RemoveFirst();break;
case 5 : list.RemoveLast();break;
case 6 : System.out.print("Insert Key :");
temporary=input.readLine();
choosen=Integer.parseInt(temporary);
list.RemoveKey(choosen);break;
case 7 : System.out.print("Insert Setelah :");
temporary=input.readLine();
choosen=Integer.parseInt(temporary);
list.InsertAfter(choosen);break;
case 8 : System.out.print("Insert Number :");
temporary=input.readLine();
choosen=Integer.parseInt(temporary);
list.InsertBefore(choosen);break;
case 9 : list.Display();break;
case 10: Answer=2;break;
default : System.out.println("Astaghfirullah!!!");break;
}
}
}
}

Send and Receive Message

Posted by Bl4ckB0y On 22.53 0 comments

tipntrick-computer.blogspot.com


source code berikut ini mengimplemntasikan tentang bagaimana sebuah proses dalam sistem operasi menerima dan mengirim pesan .....

permasalhanya sebagai berikut :
Indonesia akan mengikuti lomba lari estafet dalam olimpiade beijing 2008, simulasikan dengan menggunkan sebuah parent proses yang mengcreate 5 anak proses yang mana anak proses tersebut akan di representasikan sebagai 5 orang yang sedang berlari, pertama tongkat estafet bertuliskan "Praktikum Sisop 2008" dibawa oleh Debian, lalu Ubuntu, Mandrive Suse dan terakhir ke Dewalinux lalu kembali lagi ke Debian begitu seterusnya....?

=======================================================================================
#include "stdlib.h"
#include "unistd.h"
#include "sys/types.h"
#include "sys/ipc.h"
#include "sys/msg.h"
#include "stdio.h"
#include "string.h"
#define MSGSZ 30
#define FROMDEBIAN 1
#define FROMUBUNTU 2
#define FROMMANDRIVA 3
#define FROMSUSE 4
#define FROMDEWALINUX 5
#define TODEBIAN 5
#define TOUBUNTU 1
#define TOMANDRIVA 2
#define TOSUSE 3
#define TODEWALINUX 4
typedef struct msgbuf {
long mtype;
char mtext[MSGSZ];
} message_buf;

void debian();
void ubuntu();
void mandriva();
void suse();
void dewalinux();

int main(){
int s=0;
if(fork()==0){
debian();
}else{
if(fork()==0){
ubuntu();
}else{
if(fork()==0){
mandriva();
}else{
if(fork()==0){
suse();
}else{
if(fork()==0){
dewalinux();
}else{
int s;
printf("OLIMPIADE BEIJING 2008 LOMBA LARI ESTAFET\n\n");
printf("AMBIL POSISI : 1 2 ........ ");
scanf("%d",&s);
int msqid;
int msgflg = IPC_CREAT | 0666;
key_t key;
message_buf sbuf;
size_t buf_length;
key = 1234;
if (0>(msqid = msgget(key, msgflg )) ) {
perror("msgget");
return(1);
}
sbuf.mtype = TODEBIAN;
strcpy(sbuf.mtext, "Praktikum Sisop 2008");
buf_length = strlen(sbuf.mtext) + 1 ;
if (0>msgsnd(msqid, &sbuf, buf_length, IPC_NOWAIT) ) {
printf ("%d, %d, %s, %d\n", msqid, sbuf.mtype, sbuf.mtext, buf_length);
perror("msgsnd");
return(1);
}
}
}
}
}
}
return(0);
}

void debian(){
int msqid;
int msgflg = IPC_CREAT | 0666;
key_t key;
message_buf sbuf;
size_t buf_length;
key = 1234;
int i=0;
while(3>i){
if ( 0>(msqid = msgget(key, 0666))) {
printf("tidak mendapat pesan \n\n");
return;
}
i++;
if (0> msgrcv(msqid, &sbuf, MSGSZ, FROMDEWALINUX, 0)) {
printf("TIDAK menerima pesan \n\n");
return;
}
/*melakukan jawaban atas pesan yang diterima*/
printf("(%s) ---> DEBIAN(%d) ", sbuf.mtext,getpid());
/*mencoba mengirim pesan kepada UBUNTU*/
if (0>(msqid = msgget(key, msgflg )) ) {
perror("msgget");
return;
}
/*berhasil meminta slot pesan untukdiberikan ke ubuntu*/
sbuf.mtype = TOUBUNTU;
buf_length = strlen(sbuf.mtext) + 1 ;
if (0>msgsnd(msqid, &sbuf, buf_length, IPC_NOWAIT) ) {
printf ("%d, %d, %s, %d\n", msqid, sbuf.mtype, sbuf.mtext, buf_length);
perror("msgsnd");
return;
}else{ printf(" lanjut UBUNTU \n");}
}
}

void ubuntu(){
int msqid;
int msgflg = IPC_CREAT | 0666;
key_t key;
message_buf sbuf;
size_t buf_length;
key = 1234;
int i=0;
for(i=0;3>i;i++){
if (0>(msqid = msgget(key, 0666)) ) {
perror("error dalam mendapatkan pesan (msgget)");
return;
}

/*menerima pesan dari DEBIAN*/
if (0>msgrcv(msqid, &sbuf, MSGSZ, FROMDEBIAN, 0)) {
perror("eror saat penerimaan pesan : msgrcv");
return;
}

/*melakukan jawaban atas pesan yang diterima*/
printf("(%s) di UBUNTU (%d) ", sbuf.mtext,getpid());

/*mencoba mengirim pesan kepada MANDRIVA*/
if (0>(msqid = msgget(key, msgflg ))) {
perror("msgget");
return;
}
/*berhasil meminta slot pesan untukdiberikan ke ubuntu*/
sbuf.mtype = TOMANDRIVA;
buf_length = strlen(sbuf.mtext) + 1 ;
if (0>msgsnd(msqid, &sbuf, buf_length, IPC_NOWAIT) ) {
printf ("%d, %d, %s, %d\n", msqid, sbuf.mtype, sbuf.mtext, buf_length);
perror("msgsnd");
return;
}else{ printf(" Lanjut MANDRIVA \n", sbuf.mtext);}
}
}


void mandriva(){
int msqid;
int msgflg = IPC_CREAT | 0666;
key_t key;
message_buf sbuf;
size_t buf_length;
key = 1234;
int i=0;
for(i=0;3>i;i++){
if (0>(msqid = msgget(key, 0666))) {
perror("error dalam mendapatkan pesan (msgget)");
return;
}

/*menerima pesan dari DEBIAN*/
if (0>msgrcv(msqid, &sbuf, MSGSZ, FROMUBUNTU, 0) ) {
perror("eror saat penerimaan pesan : msgrcv");
return;
}

/*melakukan jawaban atas pesan yang diterima*/
printf("(%s) di MANDRIVA (%d) ", sbuf.mtext,getpid());

/*mencoba mengirim pesan kepada MANDRIVA*/
if (0>(msqid = msgget(key, msgflg )) ) {
perror("msgget");
return;
}
/*berhasil meminta slot pesan untukdiberikan ke ubuntu*/
sbuf.mtype = TOSUSE;
buf_length = strlen(sbuf.mtext) + 1 ;
if (0>msgsnd(msqid, &sbuf, buf_length, IPC_NOWAIT) ) {
printf ("%d, %d, %s, %d\n", msqid, sbuf.mtype, sbuf.mtext, buf_length);
perror("msgsnd");
return;
}else{ printf(" Lanjut SUSE \n", sbuf.mtext);}
}
}

void suse(){
int msqid;
int msgflg = IPC_CREAT | 0666;
key_t key;
message_buf sbuf;
size_t buf_length;
key = 1234;
int i=0;
for(i=0;3>i;i++){
if (0>(msqid = msgget(key, 0666)) ) {
perror("error dalam mendapatkan pesan (msgget)");
return;
}

/*menerima pesan dari DEBIAN*/
if (0>msgrcv(msqid, &sbuf, MSGSZ, FROMMANDRIVA, 0) ) {
perror("eror saat penerimaan pesan : msgrcv");
return;
}

/*melakukan jawaban atas pesan yang diterima*/
printf("(%s) di SUSE (%d) ", sbuf.mtext,getpid());

/*mencoba mengirim pesan kepada MANDRIVA*/
if (0>(msqid = msgget(key, msgflg )) ) {
perror("msgget");
return;
}
/*berhasil meminta slot pesan untukdiberikan ke ubuntu*/
sbuf.mtype = TODEWALINUX;
buf_length = strlen(sbuf.mtext) + 1 ;
if (0>msgsnd(msqid, &sbuf, buf_length, IPC_NOWAIT) ) {
printf ("%d, %d, %s, %d\n", msqid, sbuf.mtype, sbuf.mtext, buf_length);
perror("msgsnd");
return;
}else{ printf(" LanjutDEWALINUX \n", sbuf.mtext);}
}

}

void dewalinux(){
int msqid;
int msgflg = IPC_CREAT | 0666;
key_t key;
message_buf sbuf;
size_t buf_length;
key = 1234;
int i=0;
for(i=0;3>i;i++){
if (0>(msqid = msgget(key, 0666)) ) {
perror("error dalam mendapatkan pesan (msgget)");
return;
}
/*menerima pesan dari DEBIAN*/
if (0>msgrcv(msqid, &sbuf, MSGSZ, FROMSUSE, 0) ) {
perror("eror saat penerimaan pesan : msgrcv");
return;
}
/*melakukan jawaban atas pesan yang diterima*/
printf("(%s) di DEWALINUX (%d) ", sbuf.mtext,getpid());
if(i==2){
printf("\nFinish !!!! Allhamdulillah !!! juara 1 dari 1 peserta !!!\n");
return;
}
/*mencoba mengirim pesan kepada Debian*/
if (0>(msqid = msgget(key, msgflg )) ) {
perror("msgget");
return;
}
/*berhasil meminta slot pesan untukdiberikan ke debian*/
sbuf.mtype = TODEBIAN;
buf_length = strlen(sbuf.mtext) + 1 ;
if (0>msgsnd(msqid, &sbuf, buf_length, IPC_NOWAIT) ) {
printf ("%d, %d, %s, %d\n", msqid, sbuf.mtype, sbuf.mtext, buf_length);
perror("msgsnd");
return;
}else{ printf(" Putar ke DEBIAN \n", sbuf.mtext);}
}
}

=======================================================================================

begitulah source code buatan saya, mohon maaf jika ada kesalahan...
buat teman-teman satu praktikum dengan saya....MBACEM YO MBACEM REK TAPI DIPELAJARI..

Struct Using C

Posted by Bl4ckB0y On 19.46 0 comments

Studebt Database
/*
this program using dev C++
you can apply this program to visual C++
it use to make symple record about data of student
you can develop it to make big program
by develop the functions and the add the struct
it is just for fun
*/
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include "string.h"
#define MAX 20
#define MIN 11
/*Prototipe of struct*/
typedef struct
{
char name[MAX]; /*it is the part of struct student*/
char number[MIN];/*it is the part of struct student*/
}student;
/*this function to make new file an automatically open the file*/
void make_new(char name[20])
{
puts("Please Type the File Name with the extention :");/*it type messege to konsole
(DOS) */
gets(name);/*it insert the of file to name variabel*/
FILE *ptr; /*it is pointer to file*/
ptr=fopen(name,"wb"); /*pointer to file ptr point to file (name) (created the file)*/
fclose(ptr); /*pointer to file escape from point to file (name)*/
puts("File was created !!"); /*it type to messege to konsole (DOS) */
}
/*this functions to fill up the file*/
int fill_up(char name[20])
{
FILE *ptr; /*declarations of pointer*/
if((ptr=fopen(name,"rb+"))==NULL) /*pointer ptr point ot the file (name) using read
binary mode*/
{puts("File not Found ????"); /*it type to messege to konsole (DOS) */
return(0);} /*return to the main function*/
int k; /*it the sum of student in the file*/
k=getw(ptr); /*it take the sum of number in the file*/
printf("it found %d Record\n\n",k); /*it type the sum of student in konsole*/
if(k==-1) /*if the sum of student (k) is (-1) that meaning the file is empty*/
{k=0;fwrite(&k,sizeof(k),1,ptr);}
else{fclose(ptr);ptr=fopen(name,"ab+");} /*change the mode of operation into make,
write, and read*/
student study; /*it declare the anymous of struct student*/
int sum; /*it type to konsole about sum of student which added to file*/
printf("please insert Sum of Student : ");
scanf("%d",&sum); /*get the sum of student*/
fflush(stdin); /*clear the buffer*/
for(int j=0;sum>j;j++) /*iterate until number of sum of student which added to file*/
{
printf("Name : ");
gets(study.name); /*take the name of student*/
printf("Number: ");
gets(study.number); /*take the number of student*/
fwrite(&study,sizeof(study),1,ptr); /*write the name and number of student to
file*/
system("cls"); /*clear the console*/
}
fclose(ptr); /*close the file pointer*/
k=k+sum; /*sum of the new student added to the file*/
ptr=fopen(name,"rb+"); /*open the file again*/
fwrite(&k,sizeof(k),1,ptr); /*write the new sum of student to file*/
fclose(ptr); /*close the file pointer and return to the main*/
}
/*this function to read the data in the file*/
int read_data(char name[20])
{
student study; /*declare of the struct using initialize*/
FILE *ptr; /*file pointer*/
if((ptr=fopen(name,"rb"))==NULL) /*if file (name) not found function return to the
main*/
{puts("File not Found ?");return(0);}
int sum; /*it is sum of student in the file */
sum=getw(ptr); /*take integer data from file*/
printf("it %d Record\n\n",sum);
if(sum==-1) /*if the file is empty function return to the main*/
{puts("file is Empty???");return(0);}
for (int j=0;sum>j;j++) /*looping until sum of student*/
{
fread(&study,sizeof(study),1,ptr);
printf("%s\t%s\n",study.number,study.name);
}getch(); /*to stop until user press a key*/
system("cls"); /*clean the konsole screen*/
fclose(ptr); /*close the file pointer*/
}
/*this funtions to sort the data (record) by number*/
int sort_number(char name[20])
{
student temp ; /*it use for temporary variable using typedata struct*/
student study[10]; /*maksimum numberof student is 10, it is array of struct*/
FILE *ptr; /*file pinter*/
if((ptr=fopen(name,"rb"))==NULL) /*if ptr not found it return NULL */
{puts("file not Found");return(0);}
int sum; /*it is the sum of student in the file*/
sum=getw(ptr); /*get integer from file */
if(sum==-1) /*if the sum is (-1) the file must be Empty*/
{puts("file Empty ???");return(0);}
for (int j=0;sum>j;j++) /*load the data to the memory*/
{
fread(&temp,sizeof(temp),1,ptr); /*read data from the file*/
for(int i=0;MAX>i;i++)
{
study[j].name[i]=temp.name[i] ; /*load (name) to real struct */
}
for(int i=0;MIN>i;i++)
{
study[j].number[i]=temp.number[i]; /*load (number) to real struct*/
}
}
/*Sorting Process*/
/*it using bublesor,t you can use other sorting methode*/
for(int j=0;sum>j;j++)
{
for(int i=j+1;sum>i;i++)
{
int y=strcmp(study[j].number,study[i].number); /*compare the number*/
if(y==1)
{ /*Swaping system*/
/*because C cannot load from any array element to the another array
element*/
/*we must load it one by one*/
/*First step*/
/*load the j element to temporary element*/
for(int u=0;MAX>u;u++)
{
temp.name[u]=study[j].name[u];
}
/*the number must load too*/
for(int u=0;MIN>u;u++)
{
temp.number[u]=study[j].number[u];
}
/*second*/
/*load the i element to j element*/
for(int u=0;MAX>u;u++)
{
study[j].name[u]=study[i].name[u];
}
/*the number must load too*/
for(int u=0;MIN>u;u++)
{
study[j].number[u]=study[i].number[u];
}
/*third*/
/*load the temporary element to the i element*/
for(int u=0;MAX>u;u++)
{
study[i].name[u]=temp.name[u];
}
/*the number must load too*/
for(int u=0;MIN>u;u++)
{
study[i].number[u]=temp.number[u];
}
/*after this the element from j can swap to i, and i can swap to j*/
}
}
}
/*after all element was done to sort now we can print it to the screen*/
for(int k=0;sum>k;k++)
{
printf("%s\t%s\n",study[k].number,study[k].name);
}
fclose(ptr);
}
/*this function like the sort_number but we compare the name to sort the file*/
int sort_name(char name[20])
{
student temp;
student study[10];
FILE *ptr;
if((ptr=fopen(name,"rb"))==NULL)
{puts("file not found ?");return(0);}
int sum;
sum=getw(ptr);
printf("it found %d Record\n\n",sum);
if(sum==-1)
{puts("empty file ???");return(0);}
for (int j=0;sum>j;j++)
{
fread(&temp,sizeof(temp),1,ptr);
for(int i=0;MAX>i;i++)
{
study[j].name[i]=temp.name[i];
}
for(int i=0;MIN>i;i++)
{
study[j].number[i]=temp.number[i];
}
}
/*massage*/
for(int j=0;sum>j;j++)
{
for(int i=j+1;sum>i;i++)
{
int y=strcmp(study[j].name,study[i].name);
if(y==1)
{
/*first*/
for(int u=0;MAX>u;u++)
{
temp.name[u]=study[j].name[u];
}
for(int u=0;MIN>u;u++)
{
temp.number[u]=study[j].number[u];
}
/*second*/
for(int u=0;MAX>u;u++)
{
study[j].name[u]=study[i].name[u];
}
for(int u=0;MIN>u;u++)
{
study[j].number[u]=study[i].number[u];
}
/*third*/
for(int u=0;MAX>u;u++)
{
study[i].name[u]=temp.name[u];
}
for(int u=0;MIN>u;u++)
{
study[i].number[u]=temp.number[u];
}
}
}
}
for(int k=0;sum>k;k++)
{
printf("%s\t%s\n",study[k].number,study[k].name);
}
fclose(ptr);
}
/*thhis funtion to delete the record*/
int delete_data(char name[20])
{
student study; /*declare variabel study using type student (struct)*/
FILE *ptr;
if((ptr=fopen(name,"rb+"))==NULL)
{puts("file not found ?");return(0);}
int sum;
sum=getw(ptr);
printf("it found %d Record\n\n",sum);
if(sum==-1)
{puts("file is Empty ???");return(0);}
puts("file opened");
puts("Insert the Index : "); /*ask the number of index wan to be deleted*/
int y;scanf("%d",&y); /*take the number of index*/
if(y>sum){puts("index not found !!!");return(0);} /*if the index more big than sum,
return to teh main*/
fseek(ptr,sizeof(study)*(sum-1)+sizeof(int),SEEK_SET); /*slide pointer file to the last
element*/
fread(&study,sizeof(study),1,ptr); /*read the last element*/
fseek(ptr,sizeof(study)*(sum-y)+sizeof(int),SEEK_SET); /*slide the pointer too the
element which to be deleted*/
fwrite(&study,sizeof(study),1,ptr); /*write to the last element to the element which to
be deleted*/
sum--; /*sum decrement by 1*/
fseek(ptr,0,SEEK_SET);/*slide the pointer to the number of sum*/
fwrite(&sum,sizeof(sum),1,ptr);/*write the new sum in the file*/
fclose(ptr);/*close file*/
}
/*take the name of file*/
int open_file(char name[20])
{
puts("enter the file name and the extentions : ");
gets(name);
return(0);
}
/*it is the main function*/
main(void)
{char answer;
char name[20];
do
{
puts("type your choose: ");
puts("1.make new file");
puts("2.insert Data");
puts("3.sort by Name");
puts("4.sort by number");
puts("5.Delete Data");
puts("6.Read Data");
puts("7.Open File");
char choose;
choose=getch(); /*tkae the user choose*/
system("cls");
switch(choose) /*switch the user choose*/
{
case '1' : make_new(name);break;/*go to make new function*/
case '2' : fill_up(name);break;/*go to fill up function*/
case '3' : sort_name(name);break;/*go to sort by name function*/
case '4' : sort_number(name);break;/*go to sort by number function*/
case '5' : delete_data(name);break;/*go to delete funtion*/
case '6' : read_data(name);break;/*go to read data function*/
case '7' : open_file(name);break;/*go to oen file function*/
default : puts("that's wrong ??");
}
puts("press y for return!");
answer=getch();/*get the answer*/
}
while(answer=='y'||answer=='Y');/*repeat program if type yes (y/Y)*/
system("cls");
puts("Thank for use our software !!");
getch();
}

Invers Matrix

Posted by Bl4ckB0y On 17.24 0 comments

THE INVERS OF MATRIX USING GAUSS-JORDAN METHODE
/* CALCULATE THE INVERS OF MATRIX USING GAUSS-JORDAN METHODE*/
/*it compile using devC++ you, it implement methode of gauss jordan to invers matrix*/
#include "stdio.h"
#include "conio.h"
main(void)
{ int p[20], a[20][20], t;
int m, i, j, k, x;
printf("\ninsert size of matrix : \n");
scanf("%d", &m);
printf("\ninsert the matrix element step by step");
/* read the matrix */
for(i=1; i<=m; i++)
{ printf("\n");
for(j=1; j<=m; j++)
{ printf("A(%d,%d)= ",i, j);
scanf("%d", &a[i][j]);
}
}
/* print the matrix to konsole*/
printf("\nthe matrix: ");
for(i=1; i<=m; i++)
{ printf("\n");
for(j=1; j<=m; j++)
printf(" %2d", a[i][j]);
}
/* invertions proses */
for(i=1; i<=m; i++)
{ p[i] = a[i][j];
a[i][j] = 1;
for(j=1; j<=m; j++)
{ a[i][j] = a[i][j]/p[i];
}
for(k=1; k<=m; k++);
{ if(k != i)
{ t = a[k][i];
a[k][i] = 0;
for(x=1; x<=m; x++)
a[k][x] = a[k][x] - a[i][x] * t;
}
}
}
/* print the invertions matrix to konsole*/
printf("\n\invertion matrix : \n");
for(i =1; i <=m; i++)
{ for(j=1; j<=m; j++)
printf(" %d", a[i][j]);
printf(" \n");
}
getch();
}

Combination and Permutation

Posted by Bl4ckB0y On 17.21 0 comments

Permutation And Combination using C
*Permutation an Combination
this program to found permutation and combination of number
using C, we contruct using DevC++, you can use visual C, turbo C and many other
but maybe some funtion is not working
we recomended using DevC++ v 4.9
*/
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include "string.h"
#define MAX 20
/*it is function to calculate the permutation and combination using factorial*/
int factorial(int q)
{
if (q==0)
return(1);
else
return(q*factorial(q-1));/*this recursive funtions*/
}
/*this function to calculate the permutation*/
void permutation()
{
system("cls");/*clear konsole */
printf("\tPermutation and Combination\n");
printf("\t===========================\n\n");
char string[MAX];/*declare of array*/
printf("input : ");
gets(string);/*take the string for string*/
int long_of_string = strlen(string);/*to get the long of the string, it use for looping*/
int flag=0;/*it for flag and index the 'p' position in the array*/
for(int i=0;i {
if(string[i]=='p' || string[i]=='P')/*try to find identifier p*/
{
flag=i;break;/*save the index of p in the array to flag*/
}
}
if(flag!=0)/*if the char p was found*/
{
int firts_number=atoi(string);/*convert the first number until char p*/
int second_number= atoi(&string[flag+1]);/*convert the second number begin from
char p*/
if(firts_number>=second_number)
{
int factorial_first_number=factorial(firts_number);/*calculate factorial of
first_number*/
int factorial_second_number=factorial(second_number);/*calculate factorial of
second_number*/
printf("output : %d\n\n",factorial_first_number/factorial_second_number);/*display
permutation of firts and second number*/
}
else {printf("output : Imposible\n\n");}/*if the first number less than the second
number that imposible to permutation*/
}
else{printf("\nWrong\n");}/*if the comand without p indentity, it display wrong
messege*/
}
/*this functions to calculate the combination*/
void combination()
{
system("cls");
printf("\tpermutation and combination\n");
printf("\t===========================\n\n");
char string[MAX];
printf("input : ");
gets(string);
int long_of_string = strlen(string);/*calculate the long of string*/
int flag=0;/*it variabel to take index of char 'c' in the array*/
for(int i=0;long_of_string>i;i++)/*looping for found 'c'*/
{
if(string[i]=='c' || string[i]=='C')/*if found char c*/
{
flag=i;break;
}
}
if(flag!=0)
{
int firts_number=atoi(string);/*convert the first number until char p*/
int second_number= atoi(&string[flag+1]);/*convert the second number begin from
char p*/
if(firts_number>second_number)
{
int factorial_of_third_number=factorial(firts_number-second_number);
int factorial_of_firts_number=factorial(firts_number);
int factorial_of_second_number=factorial(second_number);
printf("output : %d\n\n", factorial_of_firts_number/(factorial_of_third_number*
factorial_of_second_number));
}
else {printf("output : imposible\n\n");}/*if the first number less than the second
number that imposible to permutation*/
}
else{printf("\nwrong code\n");}/*if the comand without p indentity, it display wrong
messege*/
}
/*this is the main program*/
main(void)
{ char u;
do
{
system("cls");
printf("\tpermutation and combination\n");
printf("\t===========================\n\n");
printf("1.PERMUTATION (ex : 12p5)\n2.COMBINATION (ex : 5c2 )\n\n");
printf("ENTER YOUR CHOOSE : ");
char p;
p=getch();/*try to take the choose of user*/
switch(p)
{
case '1' : permutation();break;/*go to permutation function*/
case '2' : combination();break;/*go to combination function*/
default : printf("\nWRONG\n");break;
}
printf("PRESS Y FOR REPEAT : ");
u=getch();/*stop until user press any key*/
}while(u=='y'||u=='Y');
}

Binary Search

Posted by Bl4ckB0y On 17.17 0 comments

Binary Search
#include "stdio.h"
#include "conio.h"
#include "string.h"
#include "stdlib.h"
/*this is funtion binary search, this funtion search a element
using the middle element as pivot and the element divided into 2 sub element
left elements are the element which less than pivot
right elements are the element which more than pivot
so the array must be sort before to use this function
if the search element more than pivot,
it will divide the right element and take the middle element of
right element as pivot, so will left element*/
void search(int array[20],int value,int cari,int pivot)
{
if(cari > array[pivot] && array [pivot] != '\0' && pivot>=0 && pivot<=value)/*it
define the right element*/
{
pivot=(value-pivot)/2+pivot;
search(array,value,cari,pivot);
}
else
if(array[pivot]>cari && array[pivot] !='\0' && pivot>=0 && value>=pivot) /*it define
the left element*/
{
value=pivot;
pivot=value/2;
search(array,value,cari,pivot);
}
else
if (cari == array[pivot]) /*it the pivot, program stop until the subject same with pivot
or not found int anoather*/
{printf(" \n found in index %d ",pivot+1);}
else
{printf("\n NOT FOUND!!!");}
}
/*this function to swap array*/
void swap(int array[20], int i, int p)
{
int g;
g=array[i];
array[i]=array[p];
array[p]=g;
}
/*this funtion to print array after the element sorted*/
void print(int array[20], int n)
{
for (int i=0;n>i;i++)
{
printf("%3d ",array[i]);
}
}
/*this function is selection sort you can use another sorting like buble sort*/
void selection(int array[20], int n)
{
int p;
for(int i=0;n-1>=i;i++)
{
p=i;
for(int j=1+i;n>j;j++)
{
if(array[p]>array[j])
{p=j;}
swap(array,i,p); /*to swap element of array*/
}
}
print(array,n);
}
/*this funtion to get input array from user*/
int input(int array[20])
{
int k;
printf("how much the array : ");
scanf("%d",&k);
for (int i=0;k>i;i++)
{
printf("insert array [%d] : ",i);
scanf("%d",&array[i]);
}
selection(array,k);
return(k);
}
/*this is the m,ain program*/
main(void)
{
printf("Binary Search Program\n");
int array[20],value,cari,pivot;
/*value is long of array*/
/*cari is the element want to search*/
/*i is pivot element*/
value=input(array);
pivot=value/2;
printf("\n\nplease, your choose : ");
scanf("%d",&cari);
search(array,value,cari,pivot);
fflush(stdin);
getch();
getch();
}

Iteration

Posted by Bl4ckB0y On 17.12 0 comments

/*play with looping*/
/*it compile using DevC++, it just for fun, play with programing*/
#include"stdio.h"
#include "conio.h"
main(void)
{
int a,b,c;
printf("insert the number of looping = ");
scanf("%d",&a);
for(b=a;b>=1;b--)
{
for(c=b;c>=1;c--)
{
printf("*");
}
printf("\n");
}
for(b=2;a>=b;b++)
{
for(c=0;c>=c-1;c++)
{
printf("*");
}
printf("\n");
}
getch();
}

Membuat Anak Proses

Posted by Bl4ckB0y On 16.57 0 comments

source code berikut ini mengimplementasikan bagaimana cara membuat sebuah anak proses, permasalahanya sebagai berikut, sebuah program akan membuat anak proses yang membalik sebuah string dari induk prosesnya.., setelah itu anak program akan mengirim kembali string yang sudah terbalik tadi ke induk proses untuk ditampilkan ke layar....?

untuk menyelesaikanya, kita butuh 2 alat yaitu pipe dan fork, pipe digunakan untuk mengirim data dari anak ke induk dan fork digunakan untuk membuat anak proses...
=====================================================================================
#include "stdio.h"
#include "string.h"
#include "sys/types.h"
#include "unistd.h"

int main(void) {
char masukan[64]; //string yang akan dibalik
char hasil_balikan[64]; //hasil balikan string
int pipa_penghubung[2]; //pipe untuk alat penghubung
printf("Masukkan input : ");
scanf("%s",&masukan);
pipe(pipa_penghubung); //inisialisasi pipe
int pid=fork(); //membuat anak proses
if ( pid== 0){
/*anak proses melakukan pembalikan*/
close(pipa_penghubung[0]); //pipa pembaca (INDEKS KE 0) ditutup;
int y=0;
int x=strlen(masukan)-1; //menghitung panjang string
while (x>=0){
hasil_balikan[y++] = masukan[x--]; //proses pembalikan
}
FILE *tulis = fdopen(pipa_penghubung[1],"w"); //membuka pipa penulis dan memasukanya ke pointer Buffer FILE
fprintf(tulis,"%s",hasil_balikan); //menulis hasil_balikan ke pointer buffer;
fclose(tulis); //pointer tulis FILE ditutup;

}
else
{
close(pipa_penghubung[1]); //menutup pipa penulis
FILE *baca = fdopen(pipa_penghubung[0],"r"); //membuka pipa pembaca dan memasukanya ke pointer Buffer FILE
fscanf(baca,"%s",hasil_balikan); //memasukan pointer isi pointer buffer file ke hasil_balikan
fclose(baca); //menutup pointer buffer FILE
hasil_balikan[strlen(masukan)]='\0'; //manambah null terminator
printf("Hasil Pembalikan : %s\n",hasil_balikan); //menulis hasil balikan ke layar
close(pipa_penghubung[0]); //menutup pipa pembaca
}
return(0);
}

Random and Randomize

Posted by Bl4ckB0y On 05.24 0 comments

/*
We using Dev C++ v 6.0 to make the source codes
Author : Nurul Huda
e-mail : h2d4890@gmail.com
*/
/*using Random and randomize*/
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include "time.h"
/*this function just for palying with programing using C
this program implement random and randomize to make a number
from 0 until 100 and the user must found the number*/
void main()
{
int e;
do{system("cls");
int a,b;
srand((unsigned) time(0));
a=rand()%100;
//printf("\n %d\n",a); //if you want to win. active this function
do{
fflush(stdin);
printf("Insert Number= ");
scanf("%d",&b);
if(b>a)
{
printf("Less\n"); /*the number is too big*/
}
else if (a>b) {printf("More\n");} /*the number is to small*/
else {printf("ok\n");} /*found the number*/
}
while(a!=b);
printf("Congratulation!\n");
printf("Try Again (1=yes) ");
scanf("%d",&e);
}
while(e==1);
}

Curi Password Lewat Google

Posted by Bl4ckB0y On 17.09 1 comments

saya dapat tulisan ini dari http://t4rak4nap4it.wordpress.com/ yang katanya dapat dari buku “google hacking for penetration testers”. tujuan saya muat supaya saya dapat membaca dan ikut mempublikasikanya...

TABEL KATA KATA KUNCI MENDAPATKAN USERNAMES
———————————————————
KATA KUNCI | KETERANGAN
———————————————————
inurl:admin inurl: |userlist Generic userlist files
———————————————————
inurl:admin filetype: |asp Generic userlist files
inurl:userlist |
———————————————————
inurl:php inurl: |Half-life statistics file, lists username and
hlstats intext: |other information
Server Username |
———————————————————
filetype:ctl |
inurl:haccess. |Microsoft FrontPage equivalent of htaccess
ctl Basic |shows Web user credentials
———————————————————
filetype:reg |
reg intext: |Microsoft Internet Account Manager can
———————————————————
”internet account manager” |reveal usernames and more
filetype:wab wab |Microsoft Outlook Express Mail address
|books
———————————————————
filetype:mdb inurl:profiles |Microsoft Access databases containing
|profiles.
———————————————————
index.of perform.ini |mIRC IRC ini file can list IRC usernames and
|other information
———————————————————
inurl:root.asp?acs=anon |Outlook Mail Web Access directory can be
|used to discover usernames
———————————————————
filetype:conf inurl:proftpd. |PROFTP FTP server configuration file
conf –sample |reveals
|username and server information
———————————————————
filetype:log username putty |PUTTY SSH client logs can reveal
|usernames
|and server information
———————————————————
filetype:rdp rdp |Remote Desktop Connection files reveal user
|credentials
———————————————————
intitle:index.of |UNIX bash shell history reveals commands
.bash_history |typed at a bash command prompt; usernames
|are often typed as argument strings
———————————————————
intitle:index.of |UNIX shell history reveals commands typed at
.sh_history |a shell command prompt; usernames are
|often typed as argument strings
———————————————————
“index of ” lck |Various lock files list the user currently using
|a file
———————————————————
+intext:webalizer +intext: |Webalizer Web statistics page lists Web user-
Total Usernames +intext: |names and statistical information
”Usage Statistics for”
———————————————————
filetype:reg reg HKEY_ |Windows Registry exports can reveal
CURRENT_USER |username usernames and other information
———————————————————

TABEL KATA-KATA KUNCI MENDAPATKAN PASSWORD

———————————————————
KATA KUNCI | KETERANGAN
———————————————————
inurl:/db/main.mdb |ASP-Nuke passwords
———————————————————
filetype:cfm “cfapplication |ColdFusion source with potential passwords
name” password
———————————————————
filetype:pass |dbman credentials
pass intext:userid
———————————————————
allinurl:auth_user_file.txt |DCForum user passwords
———————————————————
eggdrop filetype:user user |Eggdrop IRC user credentials
———————————————————
filetype:ini inurl:flashFXP.ini |FlashFXP FTP credentials
———————————————————
filetype:url +inurl:”ftp://” |FTP bookmarks cleartext passwords
+inurl:”@”
———————————————————
inurl:zebra.conf intext: |GNU Zebra passwords
password -sample -test
-tutorial –download
———————————————————
filetype:htpasswd htpasswd |HTTP htpasswd Web user credentials
———————————————————
intitle:”Index of” “.htpasswd” |HTTP htpasswd Web user credentials
“htgroup” -intitle:”dist”
-apache -htpasswd.c
———————————————————
intitle:”Index of” “.htpasswd” |HTTP htpasswd Web user credentials
htpasswd.bak
———————————————————
http://*:*@www” bob:bob |HTTP passwords (bob is a sample username)
———————————————————
“sets mode: +k” |IRC channel keys (passwords)
———————————————————
“Your password is * |Remember IRC NickServ registration passwords
this for later use”
———————————————————
signin filetype:url |JavaScript authentication credentials
———————————————————
LeapFTP intitle:”index.of./” |LeapFTP client login credentials
sites.ini modified
———————————————————
inurl:lilo.conf filetype:conf |LILO passwords
password -tatercounter2000
-bootpwd –man
———————————————————
filetype:config config intext: |Microsoft .NET application credentials
appSettings “User ID”
———————————————————
filetype:pwd service |Microsoft FrontPage Service Web passwords
———————————————————
intitle:index.of |Microsoft FrontPage Web credentials
administrators.pwd
———————————————————
“# -FrontPage-” |Microsoft FrontPage Web passwords
inurl:service.pwd
ext:pwd inurl:_vti_pvt inurl: |Microsoft FrontPage Web passwords
(Service | authors | administrators)
———————————————————
inurl:perform filetype:ini |mIRC nickserv credentials
———————————————————
intitle:”index of” intext: |mySQL database credentials
connect.inc
———————————————————
intitle:”index of” intext: |mySQL database credentials
globals.inc
———————————————————
filetype:conf oekakibbs |Oekakibss user passwords
———————————————————
filetype:dat wand.dat |Opera‚ ÄúMagic Wand‚Äù Web credentials
———————————————————
inurl:ospfd.conf intext: |OSPF Daemon Passwords
password -sample -test
-tutorial –download
———————————————————
index.of passlist |Passlist user credentials
———————————————————
inurl:passlist.txt |passlist.txt file user credentials
———————————————————
filetype:dat “password.dat” |password.dat files
———————————————————
inurl:password.log filetype:log |password.log file reveals usernames,
|passwords,and hostnames
———————————————————
filetype:log inurl:”password.log” |password.log files cleartext
|passwords
———————————————————
inurl:people.lst filetype:lst |People.lst generic password file
———————————————————
intitle:index.of config.php |PHP Configuration File database
|credentials
———————————————————
inurl:config.php dbuname dbpass |PHP Configuration File database
|credentials
———————————————————
inurl:nuke filetype:sql |PHP-Nuke credentials
———————————————————
filetype:conf inurl:psybnc.conf |psyBNC IRC user credentials
“USER.PASS=”
———————————————————
filetype:ini ServUDaemon |servU FTP Daemon credentials
———————————————————
filetype:conf slapd.conf |slapd configuration files root password
———————————————————
inurl:”slapd.conf” intext: |slapd LDAP credentials
”credentials” -manpage
-”Manual Page” -man: -sample
———————————————————
inurl:”slapd.conf” intext: |slapd LDAP root password
”rootpw” -manpage
-”Manual Page” -man: -sample
———————————————————
filetype:sql “IDENTIFIED BY” –cvs |SQL passwords
———————————————————
filetype:sql password |SQL passwords
———————————————————
filetype:ini wcx_ftp |Total Commander FTP passwords
———————————————————
filetype:netrc password |UNIX .netrc user credentials
———————————————————
index.of.etc |UNIX /etc directories contain
|various credential files
———————————————————
intitle:”Index of..etc” passwd |UNIX /etc/passwd user credentials
———————————————————
intitle:index.of passwd |UNIX /etc/passwd user credentials
passwd.bak
———————————————————
intitle:”Index of” pwd.db |UNIX /etc/pwd.db credentials
———————————————————
intitle:Index.of etc shadow |UNIX /etc/shadow user credentials
———————————————————
intitle:index.of master.passwd |UNIX master.passwd user credentials
———————————————————
intitle:”Index of” spwd.db |UNIX spwd.db credentials
passwd -pam.conf
———————————————————
filetype:bak inurl:”htaccess| |UNIX various password file backups
passwd|shadow|htusers
———————————————————
filetype:inc dbconn |Various database credentials
———————————————————
filetype:inc intext:mysql_ |Various database credentials, server names
connect
———————————————————
filetype:properties inurl:db |Various database credentials, server names
intext:password
———————————————————
inurl:vtund.conf intext:pass –cvs |Virtual Tunnel Daemon passwords
———————————————————
inurl:”wvdial.conf” intext: |wdial dialup user credentials
”password”
———————————————————
filetype:mdb wwforum |Web Wiz Forums Web credentials
———————————————————
“AutoCreate=TRUE password=*” |Website Access Analyzer user passwords
———————————————————
filetype:pwl pwl |Windows Password List user credentials
———————————————————
filetype:reg reg +intext: |Windows Registry Keys containing user
”defaultusername” intext: |credentials
”defaultpassword”
———————————————————
filetype:reg reg +intext: |Windows Registry Keys containing user
”internet account manager” |credentials
———————————————————
“index of/” “ws_ftp.ini” |WS_FTP FTP credentials
“parent directory”
———————————————————
filetype:ini ws_ftp pwd |WS_FTP FTP user credentials
———————————————————
inurl:/wwwboard |wwwboard user credentials
———————————————————

mungkin temen2 ada yang ingin melihat password dari website jerman?
mungkin sebaiknya kita juga mengganti kata “password” dengan memakai bahasa jerman tentunya dibawah ini adalah tabel 5 negara beserta terjemahan password dalam bahasa masing2 negara.

—————————————————–
BAHASA |KATA-KATA| TRANSLATE
—————————————————–
German |password | Kennwort
Spanish |password | contraseña
French |password | mot de passe
Italian |password | parola d’accesso
Portuguese |password | senha
Dutch |password | Paswoord
—————————————————–

setelah temen2 banyak mendapatkan password, apa yang akan anda lakukan?jangan berbuat jahat yang pasti, lihat2 saja isinya atau anda terlalu baik dengan memberitahu admin. jangan lupa sediakan john the ripper dirumah, sapa tau password yang disimpan sudah dalam keadaan terenkripsi.

membatasi size folder

Posted by Bl4ckB0y On 16.13 0 comments

Assalamu'alaikum.
membatasi size folder pakai shell script, itu sih gampang-gampang susah, aku sudah coba beberapa kali dan gagalnya juga berkali-kali, namun akhirnya selesai juga.

=====================================================================
if [ -z $3 ];
then
$3= $(pwd)
fi;
ls -Rs $3 | grep total | cut -c 7- | cat > sumber
cat -n sumber | tail -1 | cut -f1 > sumber2
cat sumber2
cat sumber
x=1
while [ $x -ne 8 ]
do
char=$(cut -c $x sumber2 )
if [[ $char != " " ]] ;
then
loop=$(cut -c $x-7 sumber2)
break
fi;
x=$[ $x + 1 ]
done
sum=0
while [ $loop -ge 1 ]
do
mum=$(tail -$loop sumber | head -1)
loop=$[ $loop-1 ]
sum=$[ $sum + $mum]
done
ls -s $2 > sumber
x=1
while [ $x -ne 10 ]
do

char=$(cut -c $x sumber )

if [[ $char = " " ]] ;
then
x=$[ $x-1 ]
kapas=$(cut -c -$x sumber)

break
fi;
x=$[ $x + 1 ]
done
echo "nilai SUM : $sum"
echo "nilai FILE : $kapas"
echo "nilai MAX : $1"
if [ $[ $sum + $kapas ] -gt $1 ];
then
echo "kagak Muat ??"
exit 0
fi;
cp $2 $3
rm sumber sumber2
exit 0
====================================================================
skenarionya begini, user pingin mencopy sebuah file ke suatu folder terus folder dibatasi dengan kapasitas tertentu kalo sudah melebihi kapasitas yang ditetapkan maka folder gak bisa di isi file lagi, sederhanakan..... ;->
cara jalaninya tinggal chmod aja di shell, aku simpan namanya aku.sh
huda@huda $ chmod 777 aku.sh
huda@huda $ ./aku.sh 1235 ikan.txt folderku/
1235 : maksudnya kapasitas foldernya
ikan.txt : itu nama file yang akan di copy ke folder folderku
folderku : nama folder yang akan diisi.
untuk kasusku hasilnya begini
nilai SUM : 1234
nilai FILE : 4
nilai MAX : 1235
kagak muat ??
huda@huda $

karena sudah tidak muat jadi file ikan.txt tidak dikopi ke folderku.

convert suhu lewat shell

Posted by Bl4ckB0y On 17.51 2 comments

Assalamu'alaikum semuanya................
gak ada apa-apa kok soal yang ini, isinya gak serius2 banget, cuma main-main pake shell
kali ini saya mau buat shell script buat konversi dari suhu dari berbagai satuan (celcius, reamur, kelvin dan fahreinheit).

salin aja source code berikut pake gedit, trus kasih nama terserah.sh, simpan sesuka teman-teman, kalu aku sich mending di home (/home/huda/).

---------------------------------------------------------------------------------------------------
echo "1. Celcius 2.Reamur 3. Fahreinheit 4.Kelvin"
echo -n "masukan satuan asal : "
read asal
echo "1. Celcius 2.Reamur 3. Fahreinheit 4.Kelvin"
echo -n "masukan satuan konversi : "
read konversi
echo "masukan suhu asal "
read suhu
if [ $asal = $konversi ];
then
echo "hasil $suhu"
fi;
##untuk berupa Celcius
if [ $asal -eq 1 ];
then
echo "celcius"
case $konversi in
2) echo "hasilnya $[$[$suhu * 4]/5] "
exit 0
;;
3) echo "hasilnya $[$[$suhu * 9]/5] "
exit 0
;;
4) echo "hasilnya $[$suhu + 273] "
exit 0
;;
*) echo "pilihan salah pada suhu konversi ??????" ;
exit 0
esac
fi;

##untuk berupa Reamur
if [ $asal -eq 2 ];
then
echo "reamur"
case $konversi in
1) echo "hasilnya $[$[$suhu * 5]/4] "
exit 0
;;
3) echo "hasilnya $[$[$suhu * 9]/4] "
exit 0
;;
4) echo "hasilnya $[$[$[$suhu * 5]/4] + 273] "
exit 0
;;
*) echo "pilihan salah pada suhu konversi ??????"
esac
fi;

##untuk berupa fahreinheit
if [ $asal -eq 3 ];
then
echo "fahreinheit"
case $konversi in
1) echo "hasilnya $[$[$suhu * 5]/9] "
exit 0
;;
2) echo "hasilnya $[$[$suhu * 4]/9] "
exit 0
;;
4) echo "hasilnya $[$[$[$suhu * 5]/9] + 273 ]"
exit 0
;;
*) echo "pilihan salah pada suhu konversi ??????"
esac
fi;
##untuk berupa Kelvin
if [ $asal -eq 4 ];
then
echo "kelvin"
case $konversi in
1) echo "hasilnya $[$suhu - 273] "
exit 0
;;
2) echo "hasilnya $[$[$[$suhu - 273] * 4] / 5] "
exit 0
;;
3) echo "hasilnya $[$[$[$suhu - 273] * 9] / 5] "
exit 0
;;
*) echo "pilihan salah pada suhu konversi ??????"
esac
fi;
echo "pilihan pada suhu asal Salah"
exit 0
---------------------------------------------------------------------------------------------------

buka terminal dan masuk ke folder dimana teman-temann simpan file ini. (makanya mending simpan aja di direktori /home/[nama user : klo miliku sih huda] huda/).

berik hak executable.
huda@huda-laptop$ sudo chmod 777 terserah.sh
password : xxxxx
huda@huda-laptop$ ./terserah.sh

nih....gambarnya.....

Aman tanpa Antivirus !!!

Posted by Bl4ckB0y On 17.09 3 comments

Assalamu'alaikum. salam kenal semuanya....
ngeliat judulnya pasti teman-teman banyak yang protes, masak kita bisa aman tanpa menggunakan antivirus padahal di dunia maya sana, banyak mafia Internet yang siap mengancam. ditambah lagi kita tidak pernah tahu kapan dan bagaimana para pencuri itu beraksi.

sebenarnya semua itu tergantung pilihan, alasan saya tidak menggunkan Antivirus karena :
1. Antivirus bisa bikin computer lambat, gara-gara real time memeriksa tiap file.
2. Antivirus kadang salah mendeteksi, (tau gak Installer Antivirus AVG dicurigai sebagai Virus oleh AVG sendiri lucu kan ;-} ).
3. Antivirus kadang membuat jengkel saya atas beberapa hal.

bagi temen-temen boleh setuju dan boleh tidak setuju, tapi selama 4 tahun ini saya tidak lagi memakai Antivirus, dan Alhamdulillah aman dan komputer saya sehat wal afiat. yang setuju silakan ikuti (tapi aku gak mau tanggung jawab lho klo ada masalah ;o) ). yang gak ya mohon maaf.
ini cara :
1. mengenali karakteristik Virus sebelum Virus Aktif
selama memiliki komputer, virus yang mampir di komputerku ada banyak, tapi masih dalam satu jenis, yaitu Virus lokal yang ditulis pake bahasa visual basic. belum pernah aku kena virus International (orang indonesia jago bikin Virus ya...). untuk itu, yang penting adalah mencegah virus itu mampir dikomputer kita. kalo virus keburu mampir, aku belum pernah nemuin satu Antivirus pun yang bisa membuat normal kembali 100%, kalu yang lumayan sich PCMAV. tapi tetep aja kerja komputer tidak seperti sebelum kena virus.
virus buatan Lokal memilki beberapa ciri, biasanya menyamar sebagai folder tapi kalau di explorer di tampilkan secara detail ekstensinya .exe kalau menemui hal seperti ini, pasti ini adalah virus, langsung saja di shift+delete.
selain itu virus juga menyamar menjadi file-file lain seperti .jpg, .bmp dan lain-lain, ini memanfaatkan kelalaian manusia, ekstensi file virus tetap .exe namun ia merubah nama mejadi virus.jpg.exe bagaimana pun jika kita lihat dari detail view filetypenya tetap apllication. pembuat virus menyamarkan namanya menjadi seperti diatas, dengan tujuan korban tertipu dan mengeksekusi virus itu karena disangka file gambar padahal bukan. jika menemui file dengan 2 ekstensi .jpg.exe / .bmp.exe / .doc.exe dll pasti itu virus langsung saja shift + delete. walaupun iconya mirip gambar/filedoc atau lainya.
dalam hal ini harus hati-hati, saran penulis tampilkan jendela explorer dalam bentuk detail, dan waspadai file dengan type application. kalo file selain ini dijamin aman.
kesalahan orang biasanya meneymbunyikan ekstensi file yang sudagh dikenali seperti gambar, music dll. misalnya jika kita sembunyikan di eksplorer akan terlihat sbb :
name type
------------------------------------------------------------------------------------
bebek JPEG image file
kuda Winamp Music file
virus.jpg Application ---> ini nich yang perlu diwaspadai

jika mendapati yang seperti ini, coba buka folder option dan pilih advance, buang centang di "Hidden filetype for known file" dan lihat apa yang terjadi :

name type
------------------------------------------------------------------------------------
bebek.jpg JPEG image file
kuda.mp3 Winamp Music file
virus.jpg.exe //type ganda Application ---> ini nich yang perlu diwaspadai


kadang-kadang virus disamarkan dengan cara seperti ini

name type
------------------------------------------------------------------------------------
bebek.jpg JPEG image file
kuda.mp3 Winamp Music file
virus.jpg. exe Application ---> ini nich yang perlu diwaspadai

lihat namanya dipanjangin pake spasi biar orang tertipu "virus.jpg. " dengan demikian ekstensi dari virus akan tersembunyi dan menipu korban pemula.

2. mencegah virus aktif
untuk mencegah virus yang aktif hati-hati dalam mengklik sesuatu, virus masuk lewat banyak jalan, namun aktif lewat dua cara, yaitu dieksekusi oleh user dan dijalankan oleh autorun milik windows. untuk masalah kedua matikan saja Autorun Windows caranya lihat postingan saya tentang tip ngebut XP.

3. apakah komputer saya kena virus ?
untuk menjawab pertanyaan ini gampang, caranya klik aja ctrl+alt+del kalau task manager muncul 70% komputer anda tidak kena virus, tes lain lagi jalankan run dan ketik regedit lalu tekan enter kalo masih bisa, komputer teman-teman masih sehat wal afiat. kok bisa yakin ? iya soalnya 2 tooll windows itu yang bisa mengancam keselamatan virus, eh satu lagi, virus juga sering mampir di C:/WINDOWS/system32/ nama_virus.exe

4. mengapa Visual Basic ?
jawaban number wahid yang membuat para Virus maker untuk membuat virus dari visual basic adalah karena visual basic menyediakan akses secara mudah dan cepat ke dalam system windows terutama registry. bisanya virus akan masuk di bagian run sehingga ia terus berjalan saat windows di start up.

5. karakter virus Visual Basic ?
virus visual basic, memilki kecenderungan utama untuk mengunci Regedit, mengunci Task manager, masuk di registry bagian run, mengunci command prompt,dan menyembunyikan proses. habis itu terserah programmernya mau dikasih fitur apa ?

6. apa yang harus dilakukan kalau kena Virus ?
kalo virus sudah aktif Antivirus pun tidak berkutik, satu-satunya cara "INSTALL ULANG", yang berarti haru memformat C:/ kalau ada data penting di drive C:/ coba backup pake Linux ke Drive lain. lalu format ulang dech, beres.

7. Tips Teraman ?
mau aman, yang paling aman kalo kita ganti OS, dari Windows ke Linux, Linux lebih aman, soalnya semua hal yang melibatkan akses penting harus izin root, lagi pula juga jarang virus di Linux.

Mount/Umount Image CD

Posted by Bl4ckB0y On 16.31 0 comments

Assalamu'alaikum
----------------------------------
salam kenal teman-teman semua :
kali ini saya mau bagi-bagi sedikit ilmu, yang sudah bisa mohon maaf : - ) namanya juga baru belajar.

Kadang-kadang kita lebih senang menggunkan Image CD untuk dijalankan di virtual CD seperti Nero Image Drive, Alkohol 120% atau program Virtual CD lain, di Windows program ini banyak namun di Linux sampai sekarang saya belum menemukan satu program pun untuk melakukan hal tersebut. nah tutorial kali ini bagaimana melakukan mounting .iso file pada virtual CD drive di Linux menggunkan shell script.
Alasan banyak orang menggunkan Virtual Drive selain efektif kita juga tidak perlu membuka-buka drive kita untuk memasukan CD jika CD tersebut memang sering dipakai.
Saya memakai Ubuntu 8.04 dengan dan GNOME untuk mempraktekannya.
caranya sebagai berikut :
buka sebuah teks editor dan ketik kode program dibawah ini :
-------------------------------------------------------------------------------------------------
#!/bin/bash
# mount

gksudo -k /bin/echo "got r00t?"

BASENAME=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS .iso`

sudo mkdir "/media/$BASENAME"

zenity --info --title "ISO Mounter" --text "$BASENAME e $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"


if sudo mount -o loop -t iso9660 $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS "/media/$BASENAME"
then
if zenity --question --title "ISO Mounter" --text "$BASENAME Successfully Mounted. Open Volume?"

then
nautilus /media/"$BASENAME" --no-desktop
fi

exit 0
else
sudo rmdir "/media/$BASENAME"

zenity --error --title "ISO Mounter" --text "Cannot mount $BASENAME!"

exit 1
fi

-------------------------------------------------------------------------------------------------
simpan di /home/[nama user teman-teman : milik saya huda] huda/ dengan nama mount.sh dan berikan hak execute pada file ini dengan mengetikan perintah di shell
$ sudo chmod 777 mount.sh
setelah itu copykan di /home/[nama user -> milik saya huda]/.gnome2/nautilus-scripts/
dengan mengetikan
$sudo cp mount.sh ~/.gnome2/nautilus-scripts/

sedangkan untuk melakukan unmount pada file .iso (Image CD) yang telah di mount gunakan saja script dibawah ini , simpan di direktory home teman-teman dan beri nama umount.sh
-------------------------------------------------------------------------------------------------
#!/bin/bash
# unmount

gksudo -k /bin/echo "got r00t?"

BASENAME=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS .iso`

sudo umount "/media/$BASENAME"

sudo rmdir "/media/$BASENAME"

zenity --info --text "Successfully unmounted /media/$BASENAME"

exit 0
-------------------------------------------------------------------------------------------------
selesai seperti tadi kita beri beri hak execute :
$ sudo chmod 777 umount.sh
setelah itu copykan di /home/[nama user -> milik saya huda]/.gnome2/nautilus-scripts/
dengan mengetikan
$sudo cp umount.sh ~/.gnome2/nautilus-scripts/

sekarang silakan cari file .iso teman-teman klik kanan pilih-> script --> mount.sh untuk melakukan unmount sama juga klik kana filenya pilih-> scipt --> umount.sh

your Ads Here

Your Ad Here FellowEquality.com