Tag Archives: Debian

install new #crontab from #bash script

you need to:

  1. save the current cron jobs for the user
  2. create a file with the new job description (pun intended)
  3. insert the new configuration
  4. check the new conf

1.
crontab -l > /tmp/current_cron
or, even better. append directly to your cron conf
crontab -l >> cronconf.txt

2.
the file should look like
cat cronconf.txt
*/1 * * * * /bin/ls >> /tmp/ls
*/1 * * * * /bin/touch /tmp/me

3.
Insert the new conf by calling crontab
crontab cronconf.txt

4.
check the new conf with
crontab -l

sharing mouse/keyboard between #debian and #windows

first step
On debian:
apt-get install x2vnc

On windows:
Install VNC Server, get the key, activate, the usual hassle.
Run VNC Server, set a password

second step
On debian:

 x2vnc 172.27.xx.xx:0 -west (then you will be prompted to type the password)

where
– 172.27.xx.xx is the IP from the windows machine
– :0 is the screen on the windows machine
– -west is the location of the windows screen from the Linux screen(s) (you can user north, south, east, west)

squid3 with basic auth #debian

apt-get install squid3 apache2-utils
htpasswd /etc/squid3/passwd user1
dpkg -L squid3 | grep ncsa_auth 

=> /usr/lib/squid3/basic_ncsa_auth

Edit /etc/squid3/squid.conf file and add:

auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

restart squid

If firefox does not display the user/password pop-up, see here and/or here.

source: http://facts-world.blogspot.fr/2010/05/configuring-squid3-with-basic.html

backlight Lenovo T430 – debian – 3.16-2-amd64

Backlight keys are no longer working since last upgrade.

ugly workaround:

root@fvaras:/home/fvaras# cat /sys/class/backlight/intel_backlight/brightness 
4437
root@fvaras:/home/fvaras# echo 2000 > /sys/class/backlight/intel_backlight/brightness 

flowblade, mirage and other python-gtk2 applications crashing in debian

version
-------
flowblade    = 1:0.12.0-dmo1
mirage       = 0.9.5.1-3
python-gtk2  = 2.24.0-4 
debian       = jessie/sid 

how to reproduce
----------------
launch on the CLI
mirage or flowblade

you will get:
-------------
"""Attempt to unlock mutex that was not locked
Aborted"""


ugly fix:
---------

search:
"gtk.gdk.threads_init"
(example vim /usr/lib/python2.7/dist-packages/mirage.py, line 74)

replace by:
gtk.gdk.threads_init()
gtk.gdk.threads_enter()


source:
-------
https://bugs.mageia.org/show_bug.cgi?id=13776

installing munin with Debian


apt-get install munin munin node


chown munin:www-data -Rv /var/cache/munin/www

/etc/munin/apache.conf

16
17 Order allow,deny
18 #Allow from localhost 127.0.0.0/8 ::1
19 Allow from all
20 #Options None
21 Options FollowSymLinks

add file munin.conf to /etc/apache2/sites-available/


   ServerAdmin root@localhost
   DocumentRoot /var/www/munin
   
       Options FollowSymLinks
       AllowOverride None
   
   LogLevel notice
   CustomLog /var/log/apache2/access.log combined
   ErrorLog /var/log/apache2/error.log
   ServerSignature On


a2ensite munin.conf

this finally did the trick:

mv /var/cache/munin/www/ /var/www/munin

expect a few updates in the following days, beacuse


tail -f /var/log/apache2/error.log /var/log/munin/munin-html.log

is still giving a few errors

found the error:

munin.conf:9:htmldir /var/cache/munin/www

replaced by /var/www/munin

source

bash inverse wildcards

If you want to ls all BUT the .sh files:


ls !(*.sh)

Example:

tatico@tortuguita:~/codigo/python/files_keeper/random_files$ ls *.sh
random_file-clean.sh  random_file_generator.sh  random_file_spread.sh
tatico@tortuguita:~/codigo/python/files_keeper/random_files$ ls !(*.sh)
file4ShdNk  filea6uHLm  fileB4sRgx  filecdQQzj  fileLYvbHv  fileo4TKHj  fileoKaCVj  fileSxbv0v  fileTlphlz  fileYLJ43w
tatico@tortuguita:~/codigo/python/files_keeper/random_files$ ls
file4ShdNk  fileB4sRgx  fileLYvbHv  fileoKaCVj  fileTlphlz  random_file-clean.sh      random_file_spread.sh
filea6uHLm  filecdQQzj  fileo4TKHj  fileSxbv0v  fileYLJ43w  random_file_generator.sh