survival – Connection to ftp server using a script and block of commands automatically
It results a bit helpful to send certain information using FTP authenticated, but automatically for scripts, as you can see highlighted.
#!/bin/bash
#
umask 002FTP_Server=”webserver.queiroz.info”
FTP_USER=cqueiroz
FTP_PASSWD=blablablaREMOTE_FTP_DIR=/home/cqueiroz/log_bkp
LOCAL_FTP_DIR=/var/log/app/
cd $LOCAL_FTP_DIR
ftp -inv $FTP_SERVER<<EOF
user $FTP_USER $FTP_PASSWD
binary
cd $REMOTE_FTP_DIR
prompt off
pwd
put *log
bye
EOF
Survival – how to remove ^M from a file
There must be many users affected when you use a file edited on Windows and once passed to Linux/Unix is common to find a character at the end of line.
Using vi editor you could fix this inconvenient.
<Esc>:%s/<Ctrl-V><Ctrl-M>//g
Bye for now.
Diversity
Outside of the corporate world, we’ve got many and different behavours imaginable related to persons.
It’s so clear when we’re able to make distinctions about how persons behave. That’s also can be called Perspection. Human Beings’ Perspections is through diferences.
We know that red color is red at all, because we really know that blue color is different from red. There was a perspection builting on our brain, if we can say on this way.
You look at towards to me and say: Hey, watch out, there’s a thing too near to your ear. So I can’t even feel, so how can he expect me to know it? It can be seen from different severals kind of angles. Engineer versus manufacture, old versus yong, who has a culture special versus how doesn’t know a thing about it. So, I mean…. Diversity is based on differences and it’s therefore absolutely the opposite of community. It’s much more comfortable living in community, it’s clear, however when you wanna gaim a strong experience and a great power of making advantages, you gotta learn to live around diversity.
C’mon, it’s can be defined by a great teamwork. Do you wanna see an exemple of teamwork at a given both collaboration and perspection? Football. How could you explain to me when such a player suddenly gives a pass to other player without even look at him and his face isn’t up to the game. Wherever position he is, he has builting on himself the perspection covered the gaps that needed to feel whenever other player will pass through his back and then he can pass the ball to him, simply to make a goal!
Well folks, that’s all for today. Cheers! Greatings from Carlos! bye
Configuring a wlan under wpa key
Forget iwconfig command, that only used on wep-key authentication.
For configuring a wpa you have to edit
/etc/wpa_supplicant/wpa_supplicant.conf
We will get something like that. if there’s any line left cut it out. Everything what don’t look like the context below is therefore unecessary.
ap_scan=1
fast_reauth=1
network= {
ssid = “my essid”
psk = “my wpa key”
}
For getting up the interface we have to type:
iw_suplicant -c /etc/wpa_suplicant/wpa_suplicant.conf -i wlan0
This method works independent from NetworkManager service. Although you get it with NetworkManager service, sometimes you’d rather to configure a simple and functional process. I’m used to work over fluxbox at minimal configuration.
Greetings from Carlos, I hope that it can be useful.
Have a fun, enjoying by awk, part 1
Let’s learn a bit of awk command once for all. SO HERE WE GO!!!!
Here I wanna describe some certain command sentences where there’s people that find it useful. I’m right one of them.
So, let’s say if you someday need to put in action a simple command line which can be able to get part of a command out and implement it whatever you want.
For exemple.
Have a look right down on this content
ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:09:6B:7F:FA:29
inet addr:10.0.46.66 Bcast:10.0.46.95 Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:414766283 errors:0 dropped:0 overruns:0 frame:0
TX packets:329442281 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Now you predict to catch all of your servers and workstations IPs and Masks up, once they’ve been put in a file list.
ifconfig eth0 | grep inet |awk {‘print $2’} >> /tmp/foobars.txt
addr:10.0.46.66
ifconfig eth0 | grep inet |awk {‘print $4’} >> /tmp/foobars.txt
Mask:255.255.255.224
Don’t be afraid, I’ll make a quick explanation about the command above.
Well, ifconfig command comes out all that description lines previously. After that, everything what came out from the ifconfig command will be redirected to other command in order. The second one (grep) will get the ifconfig output and it must return a line like this:
“inet addr:10.0.46.66 Bcast:10.0.46.95 Mask:255.255.255.224”.
We can notice some gaps after each information, awk (our next command) will get that information and split by gap.
Actually, each gap consists an information stored by a variable starting for $1.
So if you just wanna get the IP’s number and Netmask’s number information based on the list returned (inet addr:10.0.46.66 Bcast:10.0.46.95 Mask:255.255.255.224). where we’ve found:
inet ($1)
addr:10.0.46.66($2),
Bcast:10.0.46.95 ($3),
Mask:255.255.255.224 ($4).
So, here you are.
Now it’s just redirect its output to a file with “>> / tmp/foobars.txt”
Until next time!!!
A great and usually useful command to capture the graphical screen (X) through a shell.
If you sometimes have to be connected on a Linux Station through ssh connection and you by chance want to see what the user currently is doing. I’m convinced at all that kind of problem what is using up too much of your time (wasting time as it is called here). It’s due to an effort of a big friend of mine. DiDi Pena :)
Just type:
import -display :0 -window root printscreenfromblablabla.jpg
I think that’s all for today!
Have you all a good weekend.
Cheers!
How to erase files when “file list” is too large to be erased by rm command
Through find command.
find /directory –name “blablabla*” –exec rm {} \ ;
through xargs command.
ls | xargs –n10 –I rm {}
Well, I hope it could be useful!
Cheers!
Hello world!
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!