Categories
Tech Tips

How to identify package of particular file and verify its integrity

Let’s say we need to:

  1. Find out which package contains the file /bin/su in Linux
  2. Verify if the file is untainted (from package) or changed in some manner

For RPM (Fedora, Red Hat, CentOS):

$ rpm -q -f /bin/su
coreutils-5.97-34.el5
$ rpm -V coreutils-5.97-34.el5

For DEB (Debian, Ubuntu):

$ dpkg -S /bin/su
login: /bin/su
$ debsums -s -a login
Categories
Tech Tips

How to reduce size of VirtualBox VDI file

Scenario:

VirtualBox version = 4.0.12
Guest OS = Win 7
Host OS = Linux Mint 9 Isadora (based on Ubuntu)

Perform these tasks on all the Win 7 local hard-disks:

  1. chkdsk /F
  2. defrag /X
  3. sdelete -z

Shutdown the Win 7 VM, then run this command on Mint:

$ VBoxManage modifyhd win7.vdi --compact

That freed up 5GB of space for me, a 20% reduction.

Categories
Tech Tips

How to install GPMC on Windows Server 2008 R2

Command-line method:
  1. Open cmd.exe as Administrator
  2. Run this command: ServerManagerCmd.exe -install gpmc
GUI method:
  1. Open: Start > Administrative Tools > Server Manager
  2. Select ‘Features’ on the left panel
  3. Menu: Action > Add Features
  4. Check the ‘Group Policy Management’ feature
  5. Follow through the wizard to complete installation
Categories
Tech Tips

How to remove known password from protected PDF?

Install QPDF, then:

$ qpdf --password=? --decrypt in.pdf out.pdf

This doesn’t crack or guess the password for you. You must already know the password. It merely helps you to create a copy of the PDF without password protection.

Categories
Tech Tips

https page that includes other resources which are not secure

Question: How to find out what contents on a HTTPS page is retrieved using HTTP, i.e. unencrypted in transit and thus open to sniffing?

Answer: Use Google Chrome web browser’s Developer Tools. Look under “Console” and you’ll see lines that look like this:

The page at https://www.example.com displayed insecure content from http://feeds.feedburner.com/notsecure.

Categories
Tech Tips

AutoHotkey alternatives for Linux

For those of you looking for AutoHotkey alternatives for Linux, check these out:
  • compiz – OpenGL window and compositing manager
  • autokey – desktop automation utility
  • wmctrl – control an EWMH/NetWM compatible X Window Manager
  • setxkbmap – set the keyboard using the X Keyboard Extension
  • xmodmap – utility for modifying keymaps and pointer button mappings in X
  • xdotool – simulate X11 keyboard/mouse input
  • xvkbd – software virtual keyboard for X11
  • xbindkeys – a grabbing keys program for X
  • xte – Generates fake input using the XTest extension
  • xmacro – Record/play keystrokes and mouse movements in X displays

What tools do you use? Share your tips…

Categories
Tech Tips

Fix outdated/corrupted EPEL repo metadata

yum update failed in RHEL (Red Hat Enterprise Linux) server 5.5 with EPEL repo added:

[root@server ~]# yum update
Loaded plugins: rhnplugin, security
Skipping security plugin, no data
Setting up Update Process
Resolving Dependencies
Skipping security plugin, no data
--> Running transaction check
---> Package cups.x86_64 1:1.3.7-18.el5_5.8 set to be updated
---> Package cups-libs.i386 1:1.3.7-18.el5_5.8 set to be updated
---> Package cups-libs.x86_64 1:1.3.7-18.el5_5.8 set to be updated
---> Package pam.i386 0:0.99.6.2-6.el5_5.2 set to be updated
---> Package pam.x86_64 0:0.99.6.2-6.el5_5.2 set to be updated
---> Package pam-devel.i386 0:0.99.6.2-6.el5_5.2 set to be updated
---> Package pam-devel.x86_64 0:0.99.6.2-6.el5_5.2 set to be updated
---> Package yum.noarch 0:3.2.22-26.el5_5.1 set to be updated
http://mirror01.idc.hinet.net/EPEL/5/x86_64/repodata/b205b049dc386d8d09316372f16b4371cef514bb-filelists.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://ftp.riken.jp/Linux/fedora/epel/5/x86_64/repodata/b205b049dc386d8d09316372f16b4371cef514bb-filelists.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.yandex.ru/epel/5/x86_64/repodata/b205b049dc386d8d09316372f16b4371cef514bb-filelists.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://ftp.kddilabs.jp/Linux/packages/fedora/epel/5/x86_64/repodata/b205b049dc386d8d09316372f16b4371cef514bb-filelists.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://sulawesi.idrepo.or.id/epel/5/x86_64/repodata/b205b049dc386d8d09316372f16b4371cef514bb-filelists.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: failure: repodata/b205b049dc386d8d09316372f16b4371cef514bb-filelists.sqlite.bz2 from epel: [Errno 256] No more mirrors to try.
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest

Fixed with:

yum clean metadata
yum clean dbcache
yum update
Categories
Tech Tips

Own Your Space

Own Your Space

Free e-book covering many aspects of cyber security.

Get yours @ OwnYourSpace.net

Categories
Tech Tips

How to tether with the HTC Hero?

How to surf the net on a Vista laptop by using the “Mobile network” connection on the Hero?

0. Install HTC Sync on Vista

1. Turn on “Mobile network” HSPA connection on Hero

2. Connect Hero to PC via USB cable. If it prompted to install a new driver but auto search for driver failed, manually point it to the “inf” file in C:\Program Files\HTC\HTC Driver\Driver Files\Vista_x86

3. On Hero: Menu > Settings > Wireless Controls > Mobile network sharing (click to turn on)
=> Skip this step if you forgot to do Step-5 previously cos it’ll auto connect

4. It may take 3-5 mins to connect. Monitor the handshake process by clicking once on the network connection icon in the system tray on the laptop (assume Vista). When you see this, the tethering is complete and successful:

Currently connected to:
<Some new network name>
Access: Local and Internet

5. When you are done tethering, turn it off on Hero:
Menu > Settings > Wireless Controls > Mobile network sharing (click to turn off)
=> It’s better to turn off to prevent accidental use while charging phone

6. Turn off “Mobile network” HSPA connection on Hero

Categories
Tech Tips

How to Split the GNU screen in half horizontally?

1. Create two screen sessions
2. Ctrl+a S to split in half
3. Ctrl+a TAB to move to bottom half
4. Ctrl+a ” to select session
5. Ctrl+a Q to return to full size screen