A way to set proxy on linux.
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
Posted in Uncategorized
Tagged with bash, bashrc, env var, environment variable, https_proxy, http_proxy, proxy
Adding ntpd logs to rsyslog (Debian Wheezy)
# 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
Get Wifi/wlan0 working on Slackware 13.1
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
Posted in Technical (*nix_Related)
Tagged with dhcpcd, slackware 13.1, wireless configuration, wpa_gui, wpa_supplicant
PPTP vpn client configuration on Slackware 13.1
Installed ppp using slapt-get. Then downloaded and installed,
and
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
Posted in Technical (*nix_Related)
Tagged with ppp, pppd, pptp, slackware 13.1, vpn client
Enable Dual head (dual monitor) on slackware 13.1
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
Posted in Technical (*nix_Related)
Tagged with ati, dual head, dual monitor, radeon, radeon X600, slackware, slackware 13.1
My custom [dot]vimrc
“replace tabs by spaces
set expandtab“4 spaces for a tab
set tabstop=4“4 spaces to be deleted on a backspace
set softtabstop=4set 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>
Written by Anonymous
October 14, 2009 at 9:18 am
Convert/Resize image files using command line utility ‘convert’
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 !!!
Written by Anonymous
June 15, 2009 at 4:03 am
Creating a local yum repo (for RHEL) in 5 minutes
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
Posted in Technical (*nix_Related)
Tagged with local repository, redhat yum, repository, yum, yum repo
##mac@irc.freenode.net
Written by Anonymous
March 6, 2009 at 5:50 am
Posted in General
Tagged with funny irc conversation
#mac@irc.freenode.net
Written by Anonymous
March 6, 2009 at 5:46 am
Posted in Uncategorized