lgaggini
  • Member for 9 years, 3 months
  • Last seen this week
1 answers
14 votes
61k views
How can I tell pvresize to expand a physical volume to include all available space?
18 votes

As yoonix pointed out in the comment, the pvresize without options resizes physical volume to the size the operating system reports for the underlying partition. pvresize /dev/sdXY --...

View answer
2 answers
6 votes
8k views
ignore files in use (being written to) when using rsync
Accepted answer
5 votes

To check if a file is currently open (if a file is currently written is for sure open by some process) the standard way is to use lsof: if lsof /your/file > /dev/null; then echo "file currently ...

View answer
4 answers
2 votes
16k views
CloneZilla PXE Boot Without NFS
Accepted answer
5 votes

We faced the same problem and found the following to be excellent for explanations: http://gparted-forum.surf4.info/viewtopic.php?id=16400 http://sourceforge.net/projects/clonezilla/forums/forum/...

View answer
3 answers
7 votes
6k views
How to set SSH config to grab part of ssh hostname and use as variable?
3 votes

You can run a script as a custom ProxyCommand and do your works before the real ProxyCommand: .ssh/config: Host *-maria Hostname maria User jeff ProxyCommand /bin/...

View answer
5 answers
10 votes
11k views
Delete from mailq where subject matches
2 votes

Just an alternative command to do the same proposed by gview: find /var/spool/postfix/deferred/ -exec grep -l 'Subject: this was the subject line' {} \; | xargs -r -n1 basename | xargs -r -n1 ...

View answer
1 answers
0 votes
9k views
Virtual NICs and Host only adapter in KVM
2 votes

Public bridging If you have only one NIC on the KVM host and you want to have access for the VMs to main network attached to eth0 interface you have to setup a public network bridge on top of your ...

View answer
2 answers
0 votes
162 views
become root when running on specific OS
2 votes

I don't think it's possible. As a workaround you can: duplicate the task and put the condition on the os_family in a when clause - name: Become need command: become: yes when: ...

View answer
1 answers
0 votes
3k views
I am trying to use vars_prompt but when i run the playbook it directly gives me prompt and ask for the value, it doesn't checks in inventory file
1 votes

Ansible doesn't support this, from the voice of its creator Michael DeHaan: vars_prompt always prompts for the variable. I'd suggest setting a role default instead, or putting a good default value ...

View answer
3 answers
1 votes
2k views
Managing Linux user accounts + Samba + more
1 votes

I would choose some LDAP-based solution for the flexibility and the wide-support and for the GNU/Linux world your best bet is OpenLdap. At the beginning ldap world is a bit trivial but is quite solid. ...

View answer
7 answers
11 votes
10k views
How can I manage apt efficiently on multiple machines?
0 votes

Sometimes ago I wrote a low level/dirty automation Fabric script (fabfile) to meet similar requirements, you can check it at: https://gist.github.com/lgaggini/2be3c5bb47b8ce9267bd

View answer
2 answers
2 votes
362 views
Script to email if grep result is null
0 votes

If in your log you have date and time information (i think so), you can preponed to your grep another grep for filtering date and use -A {{ big_number }} to get all lines from 15 minutes ago to now. ...

View answer
2 answers
6 votes
2k views
Creating a docker container from a capistrano deploy
0 votes

Usually in Docker the preferred way to deploy an application in a container is by a dockerfile, that can replace the role of a capistrano script, mainly running commands on the container (install ...

View answer
5 answers
-1 votes
2k views
OpenLDAP and Samba, can't log onto Samba share from Windows
0 votes

Try to check the shares part in Samba configuration in /etc/samba/smb.conf (usually near the end). Maybe that in the valid users directive for the selected share there isn't the group but only the ...

View answer