User Tools

Site Tools


linux:nyttige_kommandoer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:nyttige_kommandoer [2013/03/28 16:58] larseriklinux:nyttige_kommandoer [2018/10/20 23:00] (current) – external edit 127.0.0.1
Line 6: Line 6:
 //Krever pdftk// \\ //Krever pdftk// \\
 ''pdftk *.pdf cat output alt.pdf'' tar alle pdf-filene i CWD og merger sammen i ''alt.pdf'' ''pdftk *.pdf cat output alt.pdf'' tar alle pdf-filene i CWD og merger sammen i ''alt.pdf''
 +
 +====Rotere PDF-filer====
 +**90 grader med klokka:** \\
 +''pdftk in.pdf cat 1-endeast output out.pdf''
 +
 +====Dra ut sider fra PDF-filer====
 +''pdftk full-pdf.pdf cat 12-15 output outfile_p12-15.pdf''
  
 ==== Ymse ødelagte pakker ==== ==== Ymse ødelagte pakker ====
Line 148: Line 155:
   * 2 = 90 grader mot klokka   * 2 = 90 grader mot klokka
   * 3 = 90 grader med klokka med verikal flip   * 3 = 90 grader med klokka med verikal flip
 +
 +==== Slette blokkerte IP'er fra denyhosts ====
 +WORK_DIR er /var/lib/denyhosts på Ubuntu
 +  - Stop DenyHosts
 +  - Remove the IP address from /etc/hosts.deny
 +  - Edit WORK_DIR/hosts and remove the lines containing the IP address. Save the file.
 +  - Edit WORK_DIR/hosts-restricted and remove the lines containing the IP address. Save the file.
 +  - Edit WORK_DIR/hosts-root and remove the lines containing the IP address. Save the file.
 +  - Edit WORK_DIR/hosts-valid and remove the lines containing the IP address. Save the file.
 +  - Edit WORK_DIR/user-hosts and remove the lines containing the IP address. Save the file.
 +  - Start DenyHosts
 +
 +LAG ET SKRIPT!
 +
 +==== Erstatt mellomrom i filnavn og mappenavn med underscore ====
 +<code>
 +rename 's/ /_/g' *
 +</code>
 +
 +OBS! Dette virker bare med perl-rename. IKKE linux-util rename!
 +
 +==== Rename filer med prefix ====
 +<code>
 +mv {,new.}original.filename
 +</code>
 +
 +==== Fikse ecrpytfs automount ved servermigrering ====
 +<code>
 +ln -s /home/.ecryptfs/<brukernavn>/.ecryptfs ~/.ecrpytfs
 +ln -s /home/.ecryptfs/<brukernavn>/.Private ~/.Private
 +</code>
 +
 +==== Konvertere putty-nøkler til authorized_keys ====
 +<code>
 +$ ssh-keygen -i -f putty-key.pub >> ~/.ssh/authorized_keys
 +</code>
 +
 +===== CentOS / RHEL =====
 +==== Statisk IP ====
 +///etc/sysconfig/network-scripts/ifcfg-ethX//:
 +<code>
 +DEVICE='ethX'
 +STARTMODE='auto'
 +BOOTPROTO='static'
 +IPADDR=<ip>
 +NETMASK=<netmask>
 +</code>
 +///etc/sysconfig/netowrk//:
 +<code>
 +HOSTNAME=<hostname>
 +NETWORKING=yes
 +NETWORKING_IPV6=<yes|no>
 +GATEWAY=<ip>
 +</code>
 +
 +///etc/resolv.conf//:
 +<code>
 +nameserver <dns-server-ip>
 +</code>
 +
 +Restart nettverket
 +
 +==== Endre security context i SELinux ====
 +Eks:
 +<code>chcon -Rv --type=httpd_sys_content_t /html </code>
 +[[https://wiki.centos.org/HowTos/SELinux#head-0f6390ddacfab39ee973ed8018a32212c2a02199|CentOS dok]]
 +
 +===== vim =====
 +==== Lagre med sudo ====
 +<code>:w !sudo tee %</code>
linux/nyttige_kommandoer.1364486305.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki