Rabu, 6 Januari 2016

convert JPG to PDF

Just use this:
convert *.jpg output.pdf and/or convert *.jpg -adjoin output.pdf
convert books.png books.jpeg combined.pdf
convert "*.{png,jpeg}" outfile.pdf
In general case you can combine more files into one pdf file with including them inside {} and separate them with a single comma.
convert "*.{ext1,ext2,ext3,...}" outfile.pdf

More info:
  1. http://unix.stackexchange.com/questions/29869/converting-multiple-image-files-from-jpeg-to-pdf-format
  2. http://catlingmindswipe.blogspot.my/2013/11/how-to-convert-jpg-to-pdf-using.html

tcpdump

Basic Usage
So, based on the kind of traffic I’m looking for, I use a different combination of options to tcpdump, as can be seen below:
Basic communication // see the basics without many options
# tcpdump -nS
Basic communication (very verbose) // see a good amount of traffic, with verbosity and no name help
# tcpdump -nnvvS
A deeper look at the traffic // adds -X for payload but doesn’t grab any more of the packet
# tcpdump -nnvvXS
Heavy packet viewing // the final “s” increases the snaplength, grabbing the whole packet


# tcpdump -nnvvXSs 1514

How change display resolution settings using xrandr

Xrandr is used to set the size, orientation and/or reflection of the outputs for a screen. It can also set the screen size. There are a few global options; the rest modify a particular output and follow the specification of that output on the command line.
Open the terminal and run the following commands
First you need to enter the following command
$ xrandr
This will display the allowed resolutions
Sample output

Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
VGA1 connected 800×600+0+0 (normal left inverted right x axis y axis) 267mm x 200mm
800×600 85.1* +
640×480 75.0 60.0
720×400 70.1
If you want to add a mode with resolution 1024X768, you can enter the following command: (The output is shown following.)
$ cvt 1024 768
Sample output

# 1024×768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz
Modeline "1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
Now you need to create a modeline
$ xrandr --newmode <Modeline>
copy the modeline of the previous output to the place mode line
$ xrandr --newmode "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync
Now you need to add the above mode using the following command
$ xrandr --addmode VGA1 1024x768_60.00
here for VGA1 you have to use what ever that was there for $ xrandr output
$ xrandr --output VGA1 --mode 1024x768_60.00
Running these would change your resolution but this is temporary.these steps were done to make sure that these commands work
Now we need to make these changes permanent
Now you need to edit the default file
$gksudo gedit /etc/gdm/Init/Default
Look for the following lines
PATH=/usr/bin:$PATH
OLD_IFS=$IFS
and Add the the following lines below them
xrandr --newmode "1024×768" 70.00 1024 1072 1176 1328 768 771 775 798 -hsync +vsync

xrandr --addmode VGA1 1024x768_60.00

xrandr --output VGA1 --mode 1024×768
Save and exit the file

Jumaat, 16 Januari 2015

ubuntu - how to stop apache2, mysql from starting automatically

MySQL is handled by upstart. In 11.04 you can use the new override feature to modify the starting behaviour:
echo "manual" >> /etc/init/mysql.override
Apache still uses traditional SysV init scripts so you use
 update-rc.d -f apache2 remove
to remove the links from /etc/rcX.d or, alternatively, use
 update-rc.d apache2 disable
which "disables" the script by changing it from a start script S91apache2 to a stop script K09apache2. This is reversible by update-rc.d apache2 enable.

---- Tested at ---
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

Ahad, 12 Mei 2013

View IP Address and Network Setting

A. Most basic and most popular comand - ifconfig

gnome@gnome-u:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 05:0f:b0:99:36:53
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:21

eth1      Link encap:Ethernet  HWaddr 05:13:ce:99:69:d5
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::213:ceff:fe99:69d4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:99123 errors:4 dropped:4 overruns:0 frame:0
          TX packets:88479 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:99532417 (99.5 MB)  TX bytes:9657254 (9.6 MB)

B. Another command - ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 05:0f:b0:99:36:53 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 05:13:ce:99:69:d5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.4/24 brd 192.168.1.255 scope global eth1
    inet6 fe80::213:ceff:fe99:69d5/64 scope link 
       valid_lft forever preferred_lft forever

C. Newer but more info - nm-tool
NetworkManager Tool

State: connected (global)

- Device: eth1  [Auto XXXWifi] -------------------------------------------------
  Type:              802.11 WiFi
  Driver:            ipw2200
  State:             connected
  Default:           yes
  HW Address:        05:13:CE:99:69:D5

  Capabilities:
    Speed:           36 Mb/s

  Wireless Properties
    WEP Encryption:  yes
    WPA Encryption:  yes
    WPA2 Encryption: yes

  Wireless Access Points (* = current AP)
    *XXXwifi:        Infra, 05:1E:E3:EF:E7:93, Freq 2412 MHz, Rate 54 Mb/s, Strength 76 WPA2
    TP-LINK_B1EF81:  Infra, F5:D1:11:B1:EF:82, Freq 2457 MHz, Rate 54 Mb/s, Strength 49 WPA2

  IPv4 Settings:
    Address:         192.168.1.4
    Prefix:          24 (255.255.255.0)
    Gateway:         192.168.1.1

    DNS:             192.168.1.1


- Device: eth0 -----------------------------------------------------------------
  Type:              Wired
  Driver:            b44
  State:             unavailable
  Default:           no
  HW Address:        05:0F:B0:99:36:53

  Capabilities:
    Carrier Detect:  yes

  Wired Properties
    Carrier:         off

Selasa, 7 Mei 2013

How To Insert Link Into Your Blog Comments

Here are some simple steps on how to insert a link into your comment. Just copy the code below and change the link location and link name in the given html code with your own data. That's it!

<a href="link location">link name</a>

<a href="http://afterdarkwrites.blogspot.com">AFTERDARK WRITES!</a>

Rabu, 14 November 2012

3rd Party Repository: Google Chrome


This repository is available for: Stable 

Title:Chrome browser in Google repos
Description:Google Linux repository on dl.google.com.
Daily Build:no
Setup key with:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 

Setup repository with:
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
Setup package with:
sudo apt-get update 
sudo apt-get install 
where is the name of the package you want to install.

Sabtu, 17 Mac 2012

Khamis, 15 Mac 2012

enable mod userdir under apache2

Apache2 mod userdir give each user in Ubuntu system have access their home folder under public_html. All web files, web system, etc must be put under this public_html. User or anybody can access that files/web system in any web browser using http://localhost/~username (locally) or http://ip-address/~username (in the network/intranet). Below is the command to enable the userdir mod.

1. sudo a2enmod userdir
2. service apache2 restart

To enable php you need to comment out ifModule userdir in php5.conf