Creează un cont pentru a te abona la acest blog și a-i urmări articolele pe pagina Lectură.
-
Date: 2013-07-17 Tags: python We create a dictionary called “d”: d = {'site1': {'servername': 'test.org', 'serveralias': 'www.test.org'}} We parse it with iteritems(): for key, value in d.iteritems(): print key print value['servername']
-
Date: 2013-07-17 Tags: ssh This is my configuration.
-
Date: 2013-07-17 Tags: Linux Not so much but it does the job. shopt -s histappend export HISTTIMEFORMAT='%F @ %T - ' export HISTCONTROL=erasedups:ignorespace export HISTIGNORE="pwd:[bf]g:jobs:j:h:history:exit:reboot:restart:init *" export HISTSIZE=5000 ex…
-
Date: 2013-07-17 tags: Linux Rename picture based on capture date: find -name 'IMG*.JPG' | while read PIC; do DATE=$(exiftool -p '$DateTimeOriginal' $PIC | sed 's/[: ]//g'); touch - t $(echo $DATE | sed 's/\(..$\)/\.\1/') $PIC;echo "Date:" $DATE "- " $PIC;
-
Date: 2013-07-17 Tags: Mac Type this in your terminal: defaults write com.apple.screencapture location /Full/Path/To/Folder
-
Date: 2013-07-17 Tags: Linux, Debian In /etc/apt/apt.conf APT::Install-Recommends "0";
-
Tags: Linux, Debian Date: 2013-07-17 This is a reminder as I always seem to forget something.
-
Date: 2013-07-17 Tags: Linux, Debian Under Debian, if /tmp is a partition and you set it as noexec, you might need to do this to avoid issues with apt-get.
-
Date: 2013-07-09 In this example, I’ll print line 20, 40, 60, 80, etc. of data.txt: awk '(NR%20==0)' data.txt NF The number of fields in the current input record.
-
Simply run this from the command line and it will server the content of the current directory: python -m SimpleHTTPServer 80 I recommend setting an alias for that and make sure that the port is always open from the internet.
-
categories: Automation Linux I’m currently actively working on Salt, I actually have a dozen production servers at work, running critical services through it.
-
Tags: Networks VLAN 10 is WORK VLAN 20 is HOME VLAN 30 is GUEST On the 2950, configure the port to the WAP4410N as trunk : switch#conf t switch(config)#interface fastEthernet 0/12 switch(config-if)#description WAP4410N switch(config-if)#switchport trunk n…
-
categories: Howto Security Tested on RHEL6 Add the following in /etc/tomcat6/server.xml (before the ending host tag) : <realm userbase="ou=users,dc=intranet,dc=example,dc=org" referrals="follow" connectionpassword="password" usersubtree="true" connectionu…
-
categories: Automation Debian/Ubuntu The DHCP/TFTP server holds the IP 10.10.0.2 All commands as root : mkdir -p /srv/tftp cd /srv/tftp wget http://ftp.nl.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/netboot.tar.gz tar xvzf n…
-
categories: Hardware Linux I got my hands on a out of warranty/subscription/whatever Barracuda unit.
-
categories: tags: Apache tags: Linux tags: Red Hat/CentOS Tested on RHEL 6.
-
categories: Linux Scripts Install the package “inotify-tools” with your package manager (in EPEL for RHEL).
-
I couldn’t write it better : see http://www.lecloud.net/post/29325359938/salt-to-the-rescue So basically, Salt is a configuration management system (à la Puppet) and allows remote execution (à la Rundeck).
-
categories: Automation Linux Tools Quoting rundeck.org : Rundeck is an Open Source process automation and command orchestration tool with a web console.
-
categories: ActiveMQ Howto Linux _Tested with ActiveMQ 5.4.3, Red Hat Linux Enterprise 5.7 64 bits with Sun JVM 1.5 ActiveMQ 5.5.x requires JVM 1.6_ The following is a simple copy and paste howto.
-
categories: Debian/Ubuntu Howto Security On a Debian Sid system, install the following : apt-get install libpam-google-authenticator Edit /etc/ssh/sshd_config and set : ChallengeResponseAuthentication yes Restart the service : service ssh restart Now run :
-
categories: Debian/Ubuntu Linux It seems like I have at least two options to spin down my external USB drive used for rsnapshot backups (Iomega 1TB).
-
categories: Apache We had one quite interesting problem at work.
-
2011-04-11 Tested with Active Directory 2003 and RHEL 6.0 Tested with Active Directory 2012 and RHEL 7.2 (September 2016) What we want to do : authentication against AD using Winbind and Kerberos allowing local and remote (SSH) authentication to members of
-
categories: Debian/Ubuntu Linux Postfix So you are running Debian, you added some aliases into /etc/aliases, ran newaliases, but Postfix won’t take aliases into account despite what seems to be a correct configuration : /etc/postfix/main.cf : alias_databa…
-
categories: Android Tested on my HTC Hero running Android 2.2.1 They do not make it terribly obvious, so I believe this is worth a post.
-
categories: High-Availability Red Hat/CentOS Tested on Red Hat Enterprise Linux 5.6 64 bits and VMware ESX 3.5 Edit November 2011 : Tested on RHEL6.1 and VMware ESX 4.1 If you set up a cluster, in case of failure, you’ll probably want the surviving host to
-
categories: High-Availability Red Hat/CentOS This is a rough guide and really for future personal references so I can rebuild a DRBD cluster in 3 minutes, without having to dig into DRBD docs again.
-
categories: Networks $ whois 217.136.0.0 | grep origin: origin: AS5432 $ whois -h whois.ripe.net -i origin -T route AS5432 | grep -w "route:" | awk '{print $NF}' |sort -n 46.178.0.0/15 62.4.128.0/17 80.200.0.0/15 81.169.0.0/17 81.240.0.0/14 81.244.0.0/14…
-
categories: Linux If you get something like : fetchmail: getaddrinfo("pop.gmail.com","pop3s") error: Servname not supported for ai_socktype Make sure /etc/services exists and/or is readable (644).
-
categories: Misc I bought a Brother HL-2150N printer a couple of months ago.
-
categories: Apple/Mac OS Linux This post should be OK for any kind of client/server combination.
-
categories: SSH If for some reason you want to disable public key authentication temporarily when SSH’ing into a machine, type : ssh -o PubkeyAuthentication=no user@machine You should get the prompt for the password.
-
categories: High-Availability Red Hat/CentOS I’ll consider your cluster is already up and running.
-
categories: Networks On the “client” side : iperf -u -c 239.192.95.98 -p 10000 -b 1 -i 5 -T 10 -t 120 -u : use UDP -c : run in client mode -p : port -b : bandwidth in bits/sec -i : interval in second -T : TTL -t : time to transmit in seconds On the “serve…
-
categories: Debian/Ubuntu Packages with rc status are not completely removed from the system, configuration files are still present.
-
categories: Tools Tested under Debian Lenny and Mac OS 10.6.3 I’ve been using this one for a year or so but failed to share it until now.. python -m SimpleHTTPServer 8000 This will start a simple HTTP server listening on port 8000.
-
categories: Android VPN So I finally jumped into the wonderful world of custom ROM, with my HTC Hero (unbranded German unit).
-
categories: Debian/Ubuntu Workspaces are “disabled” by default in Ubuntu Netbook Remix (actually set to one workspace) If you want 4 workspaces, in a terminal type : gconftool-2 -s /apps/metacity/general/num_workspaces 4 --type int You’ll navigate in the…
-
categories: SSH Excerpt from the man page : The interesting part is in bold.
-
categories: Networks Belgacom ISP force IP renewal for their residential ADSL customers every 36 hours for whatever stupid purpose (annoy us, sell their fixed IP option, etc.).
-
categories: Linux Tested on Debian Lenny This is how your USB drive will get the same device name (/dev/sdXX or whatever) no matter when or which USB port you plug it in. # udevinfo -a -p $(udevinfo -q path -n /dev/sdd1) Where /dev/sdd1 is the partition y…
-
categories: Linux Virtualization After adding a new drive to a VMware (and probably other virtualization systems) host, it is possible to make the Linux OS rescan the SCSI bus.
-
categories: Linux Versioning http://joey.kitenet.net/code/etckeeper/ etckeeper is a collection of tools to let /etc be stored in a git, mercurial, darcs, or bzr repository.
-
categories: Asterisk VoIP If you want to be awaken by your Asterisk PBX, here’s a simple bit of code to add in your dial plan.
-
categories: Debian/Ubuntu Howto LDAP Tested under Debian Lenny This howto is basic, as in “no security involved”.
-
categories: Apache LDAP The following are based on an OpenLDAP directory : Simple authentication : Users credentials are stored in a file created with htpasswd command AuthType Basic AuthName "Authentication" AuthUserFile /etc/apache2/passwd-file Require…
-
categories: Howto LDAP Postfix This will just explain the configuration files needed for Postfix to check against the LDAP server.
-
categories: Debian/Ubuntu Howto Networks RADIUS Wifi This one is a bit less complex than http://blog.wains.be/post/wpa2-freeradius-eap-tls/ This is actually the most basic RADIUS configuration ever, useful for quick tests.
-
categories: Apache Debian/Ubuntu Howto Versioning This is based on a fresh install.