My scribble – Technical bits

A rough page where I not so often post my office life !

A way to set proxy on linux.

leave a comment »

In bash.bashrc, add

# No Proxy
function noproxy
{
unset http_proxy HTTP_PROXY https_proxy HTTPs_PROXY
echo “proxy unset”
}

# Proxy
function proxy
{
http_proxy=http://192.168.1.200:8080
https_proxy=$http_proxy
export http_proxy https_proxy
echo “http_proxy set to :” $http_proxy
}

Written by Anonymous

November 19, 2013 at 1:47 pm

Adding ntpd logs to rsyslog (Debian Wheezy)

leave a comment »

# cat /etc/rsyslog.d/ntpd.conf
:programname, isequal, “ntpd” -/var/log/ntp.log
& ~

Written by Anonymous

January 8, 2013 at 6:40 am

Posted in Uncategorized

Tagged with , ,

Get Wifi/wlan0 working on Slackware 13.1

leave a comment »

When I finished the slackware 13.1 installation, I noticed the OS detected the wireless network card fine. I though could not see it in “/sbin/ifconfig”. I did the below to get the wifi working with a dhcp IP.

/sbin/ifconfig wlan0 up

Edited the file “/etc/wpa_supplicant.conf”, section to make it like,

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1
network={
  key_mgmt=NONE
  priority=0
}

Then I did run the command below,

sudo /usr/sbin/wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B

After this, opened the “wpa_gui” (application>internet>wpa_gui) and clicked on “scan”. In the scan window, double clicked on the wireless network that I wanted to connect, entered the password and cliked on “Add”. Once back to the wpa_gui, I changed the “Network” to the new added network and clicked on “Connect”. Once connected to the wifi router/AP, at the CLI, issue the command below to receive an IP via DHCP.

sudo /sbin/dhcpcd -d wlan0

That got my wifi working !

Written by Anonymous

July 10, 2010 at 12:30 am

PPTP vpn client configuration on Slackware 13.1

leave a comment »

Installed ppp using slapt-get. Then downloaded and installed,


http://sourceforge.net/projects/pptpclient/files/

and

http://sourceforge.net/projects/poptop/files/

then configured the configuration files as per,

http://blog.kryptoz.com/technical-linux-unix-like-related/linux-pptp-vpn-client-configuration/

Then tried

“pppd call veveo debug dump logfd 2 nodetach”

and it worked

Written by Anonymous

July 10, 2010 at 12:30 am

Enable Dual head (dual monitor) on slackware 13.1

leave a comment »

I had a Radeon X600 card which had a DVI and VGA out. I had used Debian on the desktop for a while and the grandr got me the the dual head enabled on that setup. With Slackware 13.1, after the install, I had both the monitor mirrored. When I tried place the second monitor to the left or right of the primary using the “System Settings > Display”, it just does not seem to work. So after Google a while, I found the solution for my problem. Here is what I did to get the dual head working.

First, I had to create the xorg.conf, so I did a “Xorg -configure”. You have to do this in runlevel 3 (init 3, with no X running). This command will create the xorg.conf.new in, since you have to run this as root, “/root”.

Next, I added “Virtual 2560 1024” to the Section “Screen” > SubSection “Display”, just under the line “Depth 24”. So it looks like below in my xorg.conf.new

(2560 1024, since I have monitors that support a max resolution of 1280 x 1024, If you have a better monitor, use the appropriate values)

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
		Virtual   2560 1024
	EndSubSection
EndSection

Next, I copied this file, “xorg.conf.new” to “/etc/Xorg” and did a “init 4”. Once inside KDE, I went to the “System Settings > Display” and tried to change the second monitor position to left of my DVI (which suited me) and it worked like charm !! This was easy !!

Written by Anonymous

July 9, 2010 at 11:31 pm

My custom [dot]vimrc

leave a comment »

“replace tabs by spaces
set expandtab

“4 spaces for a tab
set tabstop=4

“4 spaces to be deleted on a backspace
set softtabstop=4

set autoindent

“higlight search matches
set hls

“incremental search
set is

“Turn on syntax highlighting
syntax on

“Make backspace behave properly
set backspace=eol,start,indent

“Indentation to happen by 4 spaces
set shiftwidth=4

” Enable file type recognition
filetype plugin on

” Easy to eyes text !
set background=light

"This unsets the "last search pattern" register by hitting return
nnoremap <CR> :noh<CR><CR>

Convert/Resize image files using command line utility ‘convert’

leave a comment »

You  can use ‘convert’, a utility provided by the package “ImageMagick’ in Linux. This is very useful when you have a bunch of image files from your camera which you need to reduce the size for easy upload or convert from/to png/jpg/gif etceteras.. On a Debian flavor, all you need to do is to get ‘ImageMagick” installed first by,

kryptoz@shreyas:Pictures$ sudo aptitude install imagemagick

and once installed, use the below command to convert all the jpg files in the current directory to be resized to 1024×768 pixels.

kryptoz@shreyas:Pictures$ for file in *.jpg; do /usr/bin/convert $file -resize 1024×768 ${file%.jpg}_small.jpg; done

or

kryptoz@shreyas:Pictures$ for file in *.jpg; do /usr/bin/convert $file -resize 50% ${file%.jpg}_small.jpg; done

This will resize the JPG image files in the CWD and save a copy with small added as a part of the file name.
You can also convert the files to other formats easily using convert.

convert file1.jpg file1.png

convert file1.jpg file1.gif

comvert file1.jpg file1.bmp

See the manual for convert to learn a lot more useful options provided by the tool. Happy resizing and uploading !!!

Creating a local yum repo (for RHEL) in 5 minutes

with one comment

To create a local yum repo for RHEL in 5 minutes.

A few things before we start. I am using a Debain lenny install to host the repo and the path may be slightly different in Fedora and RHEL at some places. Also I assume that you have a web server  (apache) running and you have the ISO images of the RHEL you want the yum repo setup.

Now lets start.

Create a directory to work with

mkdir /usr/local/redhat/ ;  cd /usr/local/redhat

I had with me 5 cd iso images of RHEL5, so to mount them all…

mkdir cd{1,2,3,4,5}
for num in `seq 1 5`; do mount -o loop rhel-5-server-x86_64-disc${num}.iso cd${num}; done

Now we need to create a directory to serve the repo via http

mkdir rhel; cd rhel

Create a symbolic link pointing to /usr/local/redhat/rhel in apache’s DocumentRoot

ln -s /usr/local/redhat/rhel /var/www/rhel

now create the directories that yum repo demands,

mkdir -pv /var/www/rhel/{base,updates}/5/x86_64

Now you can either copy all the rpm files from the iso mounted directories or to save space you can do what I did,

cd /var/www/rhel/base/5/x86_64
for file in `find /usr/local/redhat -iname “*.rpm”; do ln -s $file `basename $file`; done

After this, we need to create the repodata,

createrepo /var/www/rhel/base/5/x86_64

Above command creates a directory named “repodata” in “/var/www/rhel/base/5/x86_64” and a few other files inside which yum requires access. If needed, we can fill the “updates” directory also usig the rsync or wget from the redhat’s update repo.

Now we need to configure “/etc/yum.conf” to add the new local repository. Add the below lines (modify as per your setup)

[base-local]
name=RHEL-$releasever – $basearch
failovermethod=priority
baseurl=http://<your http server>/rhel/base/5/x86_64/
enabled=1
gpgcheck=0

The end!

Written by Anonymous

April 23, 2009 at 9:04 am

##mac@irc.freenode.net

leave a comment »

Branes <kryptoz> If I have lost the OS cd that I got with the mac (g5 10.4.11), do I have to buy the OS cd again from apple ?or can I get it from somewhere else ?
Branes <TuTUXG> kryptoz, thepiratebay.org
Branes <@MacBot> tutuxg: Illegal discussion is not allowed in this channel (NO, YOU CAN’T DOWNLOAD OS X FROM P2P!)
Branes <TuTUXG> kryptoz, thepiratebay
Branes <@MacBot> tutuxg: Illegal discussion is not allowed in this channel (NO, YOU CAN’T DOWNLOAD OS X FROM P2P!)
Branes <TuTUXG> kryptoz, TPB
Branes <TuTUXG> here u go
Branes Just over an hour ago.
TuTUXG i was just telling the name of a legal web site
tumbleweed05 LOL
TuTUXG what’s wrong with that?
tumbleweed05 exactly
tumbleweed05 it is a legal website
tumbleweed05 we’re not telling kryptoz how to pirate
fynn he was in fact referring to the Trailer Park Boys
tumbleweed05 LOLOL
TuTUXG lol
fynn so only his musical taste may be questionable.
Branes set a ban on *!*@*.cg.shawcable.net.
TuTUXG was kicked from the chat room by Branes. (Branes)
tumbleweed05 LOLOL
tumbleweed05 was kicked from the chat room by Branes. (Branes)
fynn was kicked from the chat room by Branes. (Branes)
Branes Anyone else?

Written by Anonymous

March 6, 2009 at 5:50 am

Posted in General

Tagged with

#mac@irc.freenode.net

leave a comment »

Braneskryptoz> If I have lost the OS cd that I got with the mac (g5 10.4.11), do I have to buy the OS cd again from apple ?or can I get it from somewhere else ?
11:07amBranesTuTUXGkryptoz, thepiratebay.org
11:07amBranes<@MacBottutuxg: Illegal discussion is not allowed in this channel (NO, YOU CAN’T DOWNLOAD OS X FROM P2P!)
11:07amBranesTuTUXGkryptoz, thepiratebay
11:07amBranes<@MacBottutuxg: Illegal discussion is not allowed in this channel (NO, YOU CAN’T DOWNLOAD OS X FROM P2P!)
11:07amBranesTuTUXGkryptoz, TPB
11:07amBranesTuTUXG> here u go
11:08amBranesJust over an hour ago.
11:08amgm152 left the chat room. (“Lost terminal”)
11:08amTuTUXGi was just telling the name of a legal web site
11:08amtumbleweed05LOL
11:08amTuTUXGwhat’s wrong with that?
11:08amtumbleweed05exactly
11:08amtumbleweed05it is a legal website
11:08amtumbleweed05we’re not telling kryptoz how to pirate
11:08amfynnhe was in fact referring to the Trailer Park Boys
11:08amtumbleweed05LOLOL
11:08amTuTUXGlol
11:09amfynnso only his musical taste may be questionable.
11:09amBranes set a ban on *!*@*.cg.shawcable.net.
11:09amTuTUXG was kicked from the chat room by Branes. (Branes)
11:09amtumbleweed05LOLOL
11:09amtumbleweed05 was kicked from the chat room by Branes. (Branes)
11:09amfynn was kicked from the chat room by Branes. (Branes)
11:09amalexlea joined the chat room.
11:10amBranesAnyone else?

Written by Anonymous

March 6, 2009 at 5:46 am

Posted in Uncategorized