Find Files by Age and copy them to another directory

If you work with a lot of files, sometimes there is no way around sorting files, copying them out, deleting them etc. In this case I am looking for certain files, files that are not older than 1 year and want to copy them into another directory.

find . -iname '*.pdf' -type f -mtime -356 | xargs cp -t ../

Here i make use of the convinient pipe system of Linux/Unix |

The first expression (find) finds all files created in the last 365 days. These are then passed to the cp (Copy) command, which copies them into another directory.

The next xargs takes the list of files, transmitted by find and copy them to the parent .folder.

Search for a string in files and save the result

Search all files in this directory and all subdirectories containing a specific string and save the result in a file + 25 characters before and after the file This helps me very often when I have to search huge amounts of data and the terminal window can’t handle the result.

grep -r -o -P '.{0,25}searchstring.{0,25}' ./ > ~/search_result.txt

-r = recursive
-o = only matching, just the fitting line
-P = use Perl regular expressions
./ = in the actual directory

The > saves all output into a specifc file, in this case, its inside your homedirectory ~

Odoo Form View

<odoo>
   <data>
       <record id="extend_view" model="ir.ui.view">
           <field name="name">Extend model view</field>
           <field name="model">model.name</field>
           <field name="inherit_id" ref="base.view.ref"/>
           <field name="arch" type="xml">
               <xpath expr="//page[last()]" position='after'>
                   <page string="Extra field">
                       <group string="Extra group title">
                           <field name="field_name"/>
                       </group>
                   </page>
               </xpath>
           </field>
       </record>
    </data>
  <odoo>

https://snippets.cacher.io/snippet/6262025fc18cc12fecee

How to make a nice form view for an odoo module.

SSH-AGENT – Einfache SSH Loginverwaltung

Der SSH Agent ist ein Hilfsprogramm, das die Identitätsschlüssel des Benutzers und seine Passphrasen verfolgt. Der Agent kann sich dann mit den Schlüsseln bei anderen Servern anmelden, ohne dass der Benutzer erneut ein Passwort oder eine Passphrase eingeben muss. Dies implementiert eine Form des Single Sign-On (SSO).

SSH-AGENT – Einfache SSH Loginverwaltung weiterlesen