to indent a block, select lines with v or shift+v
and j or down arrow, then use the > command.
Nice one
to indent a block, select lines with v or shift+v
and j or down arrow, then use the > command.
Nice one
I wanted to create an account in my backup machine for a good friend of mine.
As laziness is a fundamental virtue I wanted to avoid as much work as possible, including the part of calling my good friend to tell him to change the password that was random generated in the second machine.
mi first try was:
(as root)
grep <user> /etc/{passwd,shadow,group} >> user_info.text
Then, copy each line of users_info.text into the passwd, shadow and group file in /etc/ on the second unit
I tried to install Go (Google’s programming language) this WE.
Under MAC OS X the install was clean, but under Debian I had a lot of error messages.
To avoid all that noise, you need to go to $GOROOT/src/pkg and edit the Makefile
search the NOTEST section and (respecting the identation) add:
http\
net\
syslog\
Try again and let me know if it works
Imagine you want to share all your music at home, avoiding annoying VoD servers. Here’s the trick:
Server: 192.168.0.11
Clients: 192.168.0.0/24 (this means: “everybody in this network”)
in the server:
apt-get install nfs-kernel-serverexportfs -ain the client(s):
192.168.0.11:/home/invitado /mnt/storage2 nfs nfsvers=3,intr,timeo=5 0 0
If you find weird RPC errors and are unable to mount NFS, edit /etc/default/portmap and comment the line OPTIONS=”", which makes portmap to listen locally.
If you are using nfs-user-server, avoid “nfsvers=3″ in the client conf.
This is an aggressive script that will -j DROP anything that moves.
This is the regexp list (noisily named “regexp-list.ib” in my filesystem):
#file containing idiotblocker's database
w00tw00t
php.my.admin
This is the script:
for i in `grep -iv ^# regexp-list.ib`
do for a in `grep -i $i /var/log/apache2/access.log | awk -F'-' '{print $1}' |sort -n | uniq`
do echo "$a found and screwed with iptables"
iptables -A INPUT -s $a -j DROP
done
done
want to build gkrellm from the source?
if you see something weird in the code below, IT’S A JOKE
If you don’t see anything weird, nevermind…life goes on
c:\>su [troll] not sudo, sudo is for newbies [/troll]
c:\>cd /usr/scr
c:\>apt-get build-dep gkrellm
c:\>apt-get source mplayer --build
you can safely go for an orange juice can now
c:\>dpkg -i gkrellm_2.3.2-5_i386.deb
And, of course this procedure will work for other packages.
Have a nice day!
you will search for existent mysql databases:
sweet@home:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2745
Server version: 5.0.51a-24+lenny2 (Debian)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| wp-database |
+--------------------+
3 rows in set (0.00 sec)
mysql> Bye
then:
sweet@home:~$ mysql -u root -p wp-database
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2747
Server version: 5.0.51a-24+lenny2 (Debian)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show tables;
+-----------------------+
| Tables_in_xxxxxx |
+-----------------------+
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_terms |
| wp_usermeta |
| wp_users |
+-----------------------+
11 rows in set (0.00 sec)
mysql> Bye
keeping in mind the quick and dirty ethics, no boring explanations, here’s my approach on how to backup wordpress’ mysql database. it’s useful to do it before upgrades, long holidays in southamerica, dull sundays, political p.o.v. modifications and because it is a healthy habit.
this is my script (if you carefully google it, you will find out that it is not an original idea)
#!/bin/sh
DBBDATE=`date +%Y-%m-%d_%H.%M.%S`
DB_USER=user
DB_ACCESS=xxxxxxxx #password
DB_NAME=wpdatabse #how you named your wp database
BLOG=TODO
mysqldump --opt -u $DB_USER -p$DB_ACCESS $DB_NAME > database_$BLOG-at-$DBBDATE.sql
#un comment the following line to make a local copy
#cp database_$BLOG-at-$DBBDATE.sql /mnt/backups
#un comment the following line to make a remote copy
#scp -P 1234 database_$BLOG-at-$DBBDATE.sql user@remote.unit.com:/mnt/backups/
Stuff written in red MUST be changed, excepting only wise people that have a FQDN like “remote.unit.com” and a partition called ‘/mnt/backups/’ or so.
pptpsetup --create --server IP.OF.VPN.SERVER --username\\
foo --password BarFoObar --encrypt --startroute -nroute add -net 192.168.0.0/24 ppp0that was an easy one.
Any comments?
A few months ago (13?) I made an upgrade and ever since I had the network icon with an X over it.
After a few moths googling I give up.
This morning I was googling for pptp help and (logically) I found the answer to my previous question:
[troll]
use vi to edit the file
[/troll]
/etc/NetworkManager/nm-system-settings.conf
change:
[ifupdown]
managed=false
to:
[ifupdown]
managed=true
Then gracefully kill all nm-system-settings instances:
killall nm-system-settings
You think that was too easy?
Me too.
Powered by WordPress