scratch

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
scratch [2017/04/27 23:10] adminscratch [2019/03/09 15:07] – [LUKS] admin
Line 1: Line 1:
  
-====== Maustasten belegen in Linux Mint (bzw. Ubuntu) ======+====== Maustasten belegen ====== 
 + 
 +===== Linux Mint (bzw. Ubuntu) =====
  
 https://help.ubuntu.com/community/ManyButtonsMouseHowto https://help.ubuntu.com/community/ManyButtonsMouseHowto
Line 14: Line 16:
    
      
-~./imwheelrc: +~/.imwheelrc: 
-  ".*" +  ".*"   
-  None, ExtBt7,   Control_L|Alt_L|Shift_L|M+  None, ExtBt7,   Alt_L|F9
  
 Und schließlich unter //Einstellungen / Tastatur / Tastenkombinationen / Fenster / Fenster verkleinern// \\ Und schließlich unter //Einstellungen / Tastatur / Tastenkombinationen / Fenster / Fenster verkleinern// \\
-//Ctrl + Alt + Shift M// einstellen.+//Alt + F9// einstellen (sollte aber auch Default sein). 
 + 
 + 
 +===== Arch Linux ===== 
 +xorg-xev, xbindkeys und xdotool installieren: 
 +  pacman -S xbindkeys xdotool xorg-xev 
 + 
 +mit //xev// Button Nummer herausfinden. 
 + 
 +Maustasten mit xbindkeys auf Tastendrücke legen: 
 +~./xbindkeysrc: 
 +  # Button 10 sends ALT+F9 
 +  "xdotool key alt+F9" 
 +  b:10 
 + 
 +xbindkeys automatisch beim Einloggen starten: 
 +~/.xprofile: 
 +  xbindkeys & 
 + 
 +In Desktop-Einstellungen ALT-F9 auf gewünschte Funktion, z.B. //Fenster minimieren// setzen. 
 + 
 + 
 +====== Mausgeschwindigkeit einstellen ====== 
 +Per 'xset'. 
 +Z.B.: 
 +''xset m 5/4 0'' 
 + 
 +Das ganze dann als Startup definieren, 
 + 
 +#cat ~/.config/autostart/mouse.desktop 
 +  [Desktop Entry] 
 +  Name=Set mouse sensitivity 
 +  Exec=xset m 5/4 0 
 +  Type=Application 
 +  Comment=Use xset to set mouse params 
 +  Comment[en_US]=Use xset to set mouse params 
 +  Comment[de_DE]=Benutzt xset um die Maus-Geschwindigkeit einzustellen 
 + 
 + 
 + 
 +Siehe auch: http://www.pontikis.net/blog/fix-mouse-sensitivity-ubuntu 
  
  
Line 48: Line 91:
 ====== Floppy auf 720 kB formatieren (USB-Laufwerk) ====== ====== Floppy auf 720 kB formatieren (USB-Laufwerk) ======
 Von https://unix.stackexchange.com/questions/219533/how-to-format-720k-fat-ie-ms-dos-floppy-on-linux-using-usb-floppy-drive Von https://unix.stackexchange.com/questions/219533/how-to-format-720k-fat-ie-ms-dos-floppy-on-linux-using-usb-floppy-drive
 +und https://fitzcarraldoblog.wordpress.com/2017/01/17/using-an-external-usb-3-5-inch-floppy-disk-drive-in-linux/
  
 '' ''
Line 59: Line 103:
 '' ''
  
 +====== Git ======
  
 +  #                                                                   #
 +  # Command line                                                      # Bitbucket (prefered)
 +  #                                                                   #
 +  
 +  
 +  ====================================== Create a new branch =====================================================
 +  
 +  # Create and checkout branch                                        Bitbucket: Create the branch in Bitbucket
 +  git checkout -b <branch>
 +                                                                      # Fetch the new branch and check it out
 +  # Push (empty) branch to the remote repository                      git fetch
 +  git push -u origin <branch>                                         git checkout LSAS-0815_CoolFeature
 +   
 +  # Do the work: edit, add, ...
 +  
 +  # Commit the branch
 +  git commit -m "Insert commit message here"
 +  
 +  # Push branch to the remote repository
 +  # ***********************************************************
 +  # Note: From Pro Git book: "In general the way to get the best of both worlds is to rebase local changes 
 +  # you’ve made but haven’t shared yet before you push them in order to clean up your story, but never rebase 
 +  # anything you’ve pushed somewhere.
 +  #
 +  # => so better first commit locally until finished, then rebase and then push to origin.
 +  # ***********************************************************
 +  git push    # Specify upstream if not already done above: git push -u origin <branch>
 +  
 +  
 +  
 +  
 +  ====================================== Rebase ==================================================================
 +  
 +  # Update master copy
 +  git checkout master
 +  git pull
 +  
 +  # go to branch which should be merged to master and make sure that remote is equal with your copy
 +  git checkout <branch>
 +  git pull    # only if branch is already pushed to origin
 +  
 +  # Start rebase
 +  git rebase master
 +  
 +  # solve conflicts with an editor e.g foo.cxx has a conflict
 +  kate foo.cxx # remove conflict
 +  git add foo.cxx
 +  
 +  # continue rebasing
 +  git rebase --continue
 +  
 +  # if there are no other conflicts to solve, push your branch to remote otherwise solve conflicts
 +  git push --force
 +  
 +  
 +  ====================================== Merge the branch with master ============================================
 +  
 +  git checkout master                                                 Bitbucket: Create pull request
 +  git merge <branch>                                                  Bitbucket: Merge
 +  git push                                                            Bitbucket: Delete <branch>
 +
 +====== LUKS ======
 +  https://wiki.archlinux.org/index.php/dm-crypt/Device_encryption
 +  
 +  #################################
 +  ########## Preparation ##########
 +  # - Boot a Linux from a USB stick or CD / DVD
 +  # - Open a terminal
 +   
 +   
 +  #################################
 +  ### Find the right partitions ###
 +  lsblk -o name,fstype,size
 +  
 +  # nvme0n1                477G
 +  # ├─nvme0n1p1 vfat       512M  <== boot
 +  # ├─nvme0n1p2 ext4     437,4G  <== root
 +  # └─nvme0n1p3 swap      39,1G
 +  
 +  # Set boot and root partition names according to above output!
 +  BOOTPART=/dev/nvme0n1p1
 +  ROOTPART=/dev/nvme0n1p2
 +  
 +  
 +  ###############################
 +  ########### Encrypt ###########
 +  # Shrink root filesystem (NOT the partition)
 +  sudo e2fsck -f $ROOTPART
 +  sudo resize2fs -M $ROOTPART
 +  
 +  ===============================================================================
 +  # A) Using luksipc
 +  
 +  #
 +  # Copy luksipc-master.zip to your home dir. If you have internet connection,
 +  # you can directly download it (wget), else copy it manually.
 +  #
 +  
 +  # cd ~
 +  # wget https://github.com/johndoe31415/luksipc/archive/master.zip
 +  # or:
 +  # wget https://confluence.opt01.net/download/attachments/5637570/luksipc-master.zip?version=1&modificationDate=1551682022444&api=v2
 +  # or copy manually:
 +  cp luksipc-master.zip ~
 +  cd ~
 +  
 +  # If you have no unzip, uncompress it with the GUI
 +  unzip luksipc-master.zip
 +  cd luksipc-master
 +  make
 +  sudo ./luksipc -d $ROOTPART
 +  
 +  # Add keyphrase (and remember it!)
 +  sudo cryptsetup luksAddKey $ROOTPART --key-file=/root/initial_keyfile.bin
 +  # Let’s check this worked (slot 0 and 1 are populated)
 +  sudo cryptsetup luksDump $ROOTPART
 +  # Let’s scrub the initial keyslot so the initial keyfile becomes useless
 +  sudo cryptsetup luksKillSlot $ROOTPART 0
 +  # And check again (slot 1 is empty now)
 +  sudo cryptsetup luksDump $ROOTPART
 +  
 +  =============================================================================== 
 +  # B) or using cryptsetup-reencrypt:
 +  sudo cryptsetup-reencrypt --type=luks2 --new --reduce-device-size 8M $ROOTPART   # or --type=luks1
 +  
 +  =============================================================================== 
 +  
 +  # resize the filesystem to its original size
 +  sudo cryptsetup luksOpen $ROOTPART newcryptofs
 +  sudo resize2fs /dev/mapper/newcryptofs
 +  
 +  
 +  ##########################################################
 +  ### Make the system boot from the encrypted filesystem ###
 +  
 +  sudo mount /dev/mapper/newcryptofs /mnt
 +  sudo mount $BOOTPART /mnt/boot
 +  
 +  # Edit /etc/mkinitcpio.conf
 +  sudo nano /mnt/etc/mkinitcpio.conf
 +  # change MODULES=() to
 +  MODULES=(nvidia_uvm nvidia_drm)
 +  # set HOOKS to
 +  HOOKS=(base systemd autodetect keyboard keymap sd-vconsole modconf block sd-encrypt filesystems fsck)
 +  
 +  
 +  # Set the content of the file /boot/loader/loader.conf:
 +  echo -e "default arch\ntimeout 5\nconsole-mode max\n" | sudo dd of=/mnt/boot/loader/loader.conf
 +  # and /boot/loader/entries/arch.conf:
 +  echo -e "title Arch Linux\nlinux /vmlinuz-linux\ninitrd /intel-ucode.img\ninitrd \
 +  /initramfs-linux.img\noptions rd.luks.name=$(lsblk $ROOTPART -o UUID -n -d)=cryptroot \
 +  root=/dev/mapper/cryptroot nvidia-drm.modeset=1" | sudo dd of=/mnt/boot/loader/entries/arch.conf
 +  # and /boot/loader/entries/arch-fallback.conf:
 +  echo -e "title Arch Linux Fallback\nlinux /vmlinuz-linux\ninitrd /intel-ucode.img\ninitrd \
 +  /initramfs-linux-fallback.img\noptions rd.luks.name=$(lsblk $ROOTPART -o UUID -n -d)=cryptroot \
 +  root=/dev/mapper/cryptroot" | sudo dd of=/mnt/boot/loader/entries/arch-fallback.conf
 +  
 +  # You might want to delete all entries in /mnt/boot/loader/entries/ except
 +  # arch.conf and arch-fallback.conf as they won't boot anymore anyway.
 +  ls /mnt/boot/loader/entries
 +  
 +  
 +  sudo chroot /mnt
 +  mount -t proc proc /proc
 +  mount -t sysfs sys /sys
 +  mount -t devtmpfs udev /dev
 +  
 +  mkinitcpio -p linux
 +  exit  # leave chroot
 +  
 +  # reboot
 +  sudo reboot
 +
 +
 +
 +  =============================================================================== 
 +  # change luks1 to luks2 (or vice versa)
 +  sudo cryptsetup convert --type=luks2 $ROOTPART
 +  
 +  =============================================================================== 
 +
 +  
  • scratch.txt
  • Last modified: 2019/03/10 13:03
  • by admin