diff options
| author | Vito Graffagnino <vito@graffagnino.xyz> | 2020-09-08 18:10:49 +0100 |
|---|---|---|
| committer | Vito Graffagnino <vito@graffagnino.xyz> | 2020-09-08 18:10:49 +0100 |
| commit | 3b0142cedcde39e4c2097ecd916a870a3ced5ec6 (patch) | |
| tree | 2116c49a845dfc0945778f2aa3e2118d72be428b /vimwiki | |
| parent | 8cc927e930d5b6aafe3e9862a61e81705479a1b4 (diff) | |
Added the relevent parts of the .config directory. Alss add ssh config
Diffstat (limited to 'vimwiki')
99 files changed, 3271 insertions, 0 deletions
diff --git a/vimwiki/3D-RPG.md b/vimwiki/3D-RPG.md new file mode 100644 index 0000000..36a7a8e --- /dev/null +++ b/vimwiki/3D-RPG.md @@ -0,0 +1,11 @@ +## 3D / RPG ## + + |---------------|--------------------------------------------| + | App Name | ipk | + |---------------|--------------------------------------------| + | No Gravity | com.realtechvr.app.nogravity_1.4.4_all.ipk | + | Assassinsa | com.gameloft.app.assassins_1.0.6_all.ipk | + | N.O.V.A. | com.gameloft.app.nova_1.0.9_all.ipk | + | Skater Nation | com.gameloft.app.skater_1.0.7_all.ipk | + |---------------|--------------------------------------------| + diff --git a/vimwiki/API.md b/vimwiki/API.md new file mode 100644 index 0000000..e5938d7 --- /dev/null +++ b/vimwiki/API.md @@ -0,0 +1,2 @@ + +##YTS## diff --git a/vimwiki/Ansys.md b/vimwiki/Ansys.md new file mode 100644 index 0000000..89f50ed --- /dev/null +++ b/vimwiki/Ansys.md @@ -0,0 +1,22 @@ +ANSYS needs frequent licence updates. To do this: + + Copy the licence file to */soft/ansys_inc/shared_files/licenses/* + + Ssh –X to headnode2 and become root + + Run `/soft/ansys_inc/shared_files/licensing/lic_admin/anslic_admin` + + Select `‘Launch the ANSYS licence manager’` + + In the web browser window select `‘Add a licence file’` + + Select the file you copied + + Select `‘reread’`. + + Check that the licence manager is still running (green tick). + + + + + diff --git a/vimwiki/Applications.md b/vimwiki/Applications.md new file mode 100644 index 0000000..df93ab4 --- /dev/null +++ b/vimwiki/Applications.md @@ -0,0 +1,61 @@ +## Applications ## + + |--------------------------|-----------------------------------------------|---| + | App Name | ipk | | + |--------------------------|-----------------------------------------------|---| + | Phone | - | | + | Web | - | | + | Email | - | | + | Messaging | - | | + | Camera | - | | + | Tasks | - | | + | Calendar | - | | + | Photos | - | | + | Memos | - | | + | Videos | - | | + | Music (Remix) | com.hedami.musicplayerremix_2.5.11_all.ipk | | + | Evernote | com.evernote.palm.app.evernote_1.4.15_all.ipk | | + | Tapnote | com.onecrayon.tapnote_1.7.0_all.ipk | | + | FeedSpider | com.othelloventures.feedspider2_2.0.2_all.ipk | | + | GuttenPodder | | | + | Voice Memos | | | + | Voice Dial | | | + | AccuWeather | | | + | FlashCards | | | + | Picsel Smart Office | | | + | Notes | | | + | Clock | | | + | Timepiece | | | + | Reciva | | | + | TuneIn by RadioTime | | | + | Google Maps | | | + | Clipboard | | | + | AuctionMate Pro for eBay | | | + | foursquare | | | + | London Tube Service Free | | | + | Amazon book search | | | + | My3 | | | + | YouTube | | | + | Bluetooth Presenter | | | + | Quick Compass | | | + | E Notes (free) | | | + | Front camera | | | + | pReader | | | + | AgendaZ | | | + | Navit | | | + | London Tube Status | | | + | SchedMyPhone | | | + | pivotCE | | | + | Movie DB | | | + | LuneTube | | | + | Forums | | | + | ReadOnTouch Pro | | | + | Shopping Manager | | | + | Voice Recorder | | | + | Love Voucher | | | + | Navit Maps | | | + | Zap Photoshare | | | + |--------------------------|-----------------------------------------------|---| + + + diff --git a/vimwiki/Apt.md b/vimwiki/Apt.md new file mode 100644 index 0000000..4992fcd --- /dev/null +++ b/vimwiki/Apt.md @@ -0,0 +1,5 @@ + + +[Troubleshooting - Apt](Troubleshooting - Apt) + + diff --git a/vimwiki/Backup.md b/vimwiki/Backup.md new file mode 100644 index 0000000..a1e74af --- /dev/null +++ b/vimwiki/Backup.md @@ -0,0 +1,6 @@ +An rsync snapshot of */home* is taken nightly to */beegfs/backup/home*, +readable only to root. If someone deletes vital files from */home*, +we can recover them, but only before the end of the day. + +__Please respond quickly to any requests of this sort!__ + diff --git a/vimwiki/Basic operations.md b/vimwiki/Basic operations.md new file mode 100644 index 0000000..1a99ad7 --- /dev/null +++ b/vimwiki/Basic operations.md @@ -0,0 +1,57 @@ +_BASIC OPERATIONS_ + + +# Action Arch Debian/Ubuntu + +1. Install a package(s) by name `pacman -S` `apt install` + +2. Remove a package(s) by name `pacman -Rs` `apt remove` + +3. Search for package(s) `pacman -Ss` `apt search` + +4. Upgrade Packages `pacman -Syu` `apt update && apt upgrade` +- Install packages which have an older version +- already installed + +5. Upgrade Packages `pacman -Syu` `apt update && apt dist-upgrade` +- Another form of the update command, which can +- perform more complex updates -- like +- distribution upgrades. When the usual update +- command will omit package updates, which +- include changes in dependencies, this command +- can perform those updates. + +6. Clean up all local caches. `pacman -Sc` `apt autoclean` +- Options might limit what is actually cleaned. `pacman -Scc` `apt clean` +- Autoclean removes only unneeded, obsolete +- information. + +7. Remove dependencies that are no longer needed, `pacman -Qdtq | pacman -Rs -` `apt autoremove` +- because e.g. the package which needed the +- dependencies was removed. + +8. Remove packages no longer included in any `pacman -Qmq | pacman -Rs -` `aptitude purge '~o'` +- repositories. + +9. Mark a package previously installed as a `pacman -D --asexplicit` `apt-mark manual` +- dependency as explicitly required. + +10. Install package(s) as dependency / without `pacman -S --asdeps` `apt-mark auto` +- marking as explicitly required. + +11. Only downloads the given package(s) +- without unpacking or installing them `pacman -Sw` `apt install --download-only` (into package cache) + `apt download` (bypass the package cache) +12. Start a shell to enter multiple commands in `apt-config shell` +- one session + +13. Show a log of actions taken by the software `cat /var/log/pacman.log` `cat /var/log/dpkg.log` +- management. + +14. Get a dump of the whole system information `(see /var/lib/pacman/local)` `apt-cache stats` +- Prints, Saves or similar the current state +- of the package management system. +- Preferred output is text or XML. + +15. e-mail delivery of package changes. `apt install apt-listchanges` + diff --git a/vimwiki/Blocked IP Addresses.md b/vimwiki/Blocked IP Addresses.md new file mode 100644 index 0000000..6705f49 --- /dev/null +++ b/vimwiki/Blocked IP Addresses.md @@ -0,0 +1,19 @@ +An application called `fail2ban` blocks IP addresses with repeated failed login attempts. +If a user is locked out of ssh connections, this is usually why. + +If you suspect this has happened to someone, you need to know which cluster address they are trying to +log in to and ideally what IP address they are coming in from. Each machine that runs an ssh server +has its own fail2ban list. + +As root on the machine that the user is trying to log in to, do + +`fail2ban-client set sshd unbanip IPADDRESS` + +Note that normal users log in to both headnode1 and headnode2, so the problem may show up on one or +both of these machines. It can’t hurt to unban an IP that is not banned, so you can just do e.g. + +`sudo pdsh –w ‘headnode[1-2]’ fail2ban-client set sshd unbanip IPADDRESS` + +which will unban the IP on both head nodes2. If you have a problem working out the IP that’s banned, +try looking at `/var/log/secure.log` on the login machine. + diff --git a/vimwiki/Blocked IP addess.md b/vimwiki/Blocked IP addess.md new file mode 100644 index 0000000..5d752e8 --- /dev/null +++ b/vimwiki/Blocked IP addess.md @@ -0,0 +1,25 @@ +Unlike the cluster which uses fail2ban to block ip addresses, if a user is prevented from connecting to star server +the process is a little different. + +`star-server` uses the `denyhosts` service which adds the ip address to the file: `/etc/hosts.deny` + +However simply removing the ip address from this file is not sufficient. Firstly the denyhosts service has to be stopped by the following command: + +`$ systemctl stop denyhosts.sevice` + +Then the ip address has to be removed from the following files: + +`/etc/hosts.deny` +`/var/lib/denyhosts/hosts` +`/var/lib/denyhosts/hosts-restricted` +`/var/lib/denyhosts/hosts-root` +`/var/lib/denyhosts/hosts-valid` +`/var/lib/denyhosts/users-hosts` + +The denyhosts service can then be restarted with: + +`$ systemctl start denyhosts.sevice` + + + + diff --git a/vimwiki/Bluetooth.md b/vimwiki/Bluetooth.md new file mode 100644 index 0000000..1bef6a4 --- /dev/null +++ b/vimwiki/Bluetooth.md @@ -0,0 +1,46 @@ +# Bluetooth # + +if the following fails to connect/pair successfully, then issue the following command: + +`sudo rfkill unblock bluetooth` + +So to start we issue the following commands to make sure that bluetooth is running and enabled. + +`sudo systemctl restart bluetooth` + + `sudo systemctl enable bluetooth ` (this is only if you wish bluetooth to start at boot-up) + +we can then check that this is so with: + +`systemctl status -l bluetooth` + +You can then enter the bluetooth shell with: + +`bluetoothctl` + +Turn the power on and find out the device MAC address: + +`power on` + +`devices` + +if not paired you can enter `pair MAC_ADDRESS`. if already pair you can enter `trust MAC_ADDRESS` + +then enter `connect MAC_ADDRESS` + + +you can now exit and use pavucontrol or the scripts pa-global or pa-solo to redirect sound to the headset. + +Ref: Archlinux Wiki [bluetooth](https://wiki.archlinux.org/index.php/bluetooth) + + +To prevent audio autoskipping with the A2DP profile try the following: + +`echo "options iwlwifi bt_coex_active=0" | sudo tee -a /etc/modprobe.d/iwlwifi.conf` + +This disables the bluetooth coexistance parameter of the iwlwifi module (sometimes wifi intereferes with the bluetooth) +In this setups case the file may actually be 50-iwl3945.conf so modify the above as follows. + +`echo "options iwl3945 bt_coex_active=0" | sudo tee -a /etc/modprobe.d/50-iwl3945.conf` + + diff --git a/vimwiki/Board Games.md b/vimwiki/Board Games.md new file mode 100644 index 0000000..faf3e4f --- /dev/null +++ b/vimwiki/Board Games.md @@ -0,0 +1,9 @@ +## Board Games ## + + |----------|---------------------------------------| + | App Name | ipk | + |----------|---------------------------------------| + | Reversi | com.boatrights.reversi_1.0.23_all.ipk | + |----------|---------------------------------------| + + diff --git a/vimwiki/Browsers.md b/vimwiki/Browsers.md new file mode 100644 index 0000000..863a92c --- /dev/null +++ b/vimwiki/Browsers.md @@ -0,0 +1,4 @@ +[Firefox](Firefox) + +qutebrowser + diff --git a/vimwiki/Cards.md b/vimwiki/Cards.md new file mode 100644 index 0000000..b0950be --- /dev/null +++ b/vimwiki/Cards.md @@ -0,0 +1,18 @@ +## Cards / Puzzles ## + + |---------------------|--------------------------------------------| + | App Name | ipk | + |---------------------|--------------------------------------------| + | TileStorm | com.jakyl.tilestorm_1.0.1_all.ipk | + | Woodenigma | com.jasotec.app.woodenigma_1.1.5_all.ipk | + | Mazer | com.chofter.mazer_1.3.5_all.ipk | + | Wobble Words | com.grrok.wobblewords_2.0.2_all.ipk | + | Crosswords | com.standalone.crosswords_2.0.3_all.ipk | + | Yatze for WebOS | com.magicapps.yatzeeforwebos_2.8.5_all.ipk | + | 2048 | com.dta3team.2048_1.0.1_all.ipk | + | Lines Classic | com.ximad.linesclassic_1.0.0_all.ipk | + | Orbland Demo | com.naggel.orbland_1.0.1_all.ipk | + | Wild 'n Video Poker | com.fxspec.wildnpoker_1.5.0_all.ipk | + |---------------------|--------------------------------------------| + + diff --git a/vimwiki/Catholic.md b/vimwiki/Catholic.md new file mode 100644 index 0000000..75432bc --- /dev/null +++ b/vimwiki/Catholic.md @@ -0,0 +1,12 @@ +## Catholic ## + + |---------------------------|---------------------------------------------| + | App Name | ipk | + |---------------------------|---------------------------------------------| + | BibleZ Pro | de.zefanjas.biblezpro_1.1.4_all.ipk | + | Daily Audio Mass Readings | com.beep2bleep.dailyaudiomass_1.0.1_all.ipk | + | Christian Calender | cc.christ_1.0.1_all.ipk | + | Good Jew | com.firebrandforges.goodjew_1.5.4_all.ipk | + | Zman2Go | com.rocketouch.zman2go_0.6.5_all.ipk | + |---------------------------|---------------------------------------------| + diff --git a/vimwiki/Changing a User's shell.md b/vimwiki/Changing a User's shell.md new file mode 100644 index 0000000..f6fc23c --- /dev/null +++ b/vimwiki/Changing a User's shell.md @@ -0,0 +1,3 @@ +Many users prefer to use bash rather than tcsh, which is the default. +To change the shell to bash, run `sudo /root/ldifs/switch_to_bash.py username` + diff --git a/vimwiki/Characterising Exoplanets: Theory and Data Driven perspectives.md b/vimwiki/Characterising Exoplanets: Theory and Data Driven perspectives.md new file mode 100644 index 0000000..6fb03c5 --- /dev/null +++ b/vimwiki/Characterising Exoplanets: Theory and Data Driven perspectives.md @@ -0,0 +1,43 @@ + +###Characterising Exoplanets: Theory and Data Driven perspectives### + +1. Intro + +Science Drivers - Planetary System formation and Life + +Habitability - theory driven "habitable zone" - must understand composition/geology/atmoph. heat transport & dynamics/ hist & evol of atmos. + +[Kepler Orrery:](https://www.youtube.com/watch?v=et7QmD32tjs) + +__Jason Wang animation of exoplanets__ + + +####Should be skeptical of data-poor theory driven expectations#### + +Exoplanet obs. are approachind data volume/quality of pre-space solar system obsns. + +### Interface % theory & observn #### + +Depends on question - parameter estimaion +-model selection + +also whos asking question: Planetry Scietist / stellar astronomers + +obsn(masses/raddii/orbits)->theory(bulk comp/dynam hist)->'obs'/ther(planet formation models) + +Observations: + +transiting planets (spectr-> radius & atmos) +eclipse spec (atmos) + +High Res Spec -> atmos + +Radial vel -> mass & dynamics + +Direct imaged -> astrometric orbits-> mass & dynam +specetroo + + + + + diff --git a/vimwiki/Check User Login.md b/vimwiki/Check User Login.md new file mode 100644 index 0000000..30b8a68 --- /dev/null +++ b/vimwiki/Check User Login.md @@ -0,0 +1,138 @@ + +# How to check last login time for user # + +There are a number of ways to check last logged in users with time details. + +1. `last` This command searches back through the file `/var/log/wtmp (or the file designated by the -f flag)` + and displays a list of all users logged in/out since the file was created. + + *Example*__To view last login of all users:__ + + `$ last` + `bob pts/7 server1.example Mon May 5 14:36 still logged in` + `bob pts/5 server1.example Mon May 5 14:34 still logged in` + `root pts/5 main.test Sun Apr 27 04:18 - 04:20 (00:02)` + `john pts/11 server1.example Sat Apr 26 06:25 - 17:16 (10:51)` + `john pts/10 server1.example Sat Apr 26 06:20 - 17:16 (10:56)` + +2. + *Example*__To view last login of specific user:__ + + `$ last bob` + `bob pts/7 server1.example Mon May 5 14:36 still logged in` + `bob pts/5 server1.example Mon May 5 14:34 still logged in` + +3. + *Example*__To view ip address details of the source machine:__ + + `$ last bob -i` + `bob pts/7 192.168.0.100 Mon May 5 14:36 still logged in` + `bob pts/5 192.168.0.100 Mon May 5 14:34 still logged in` + +3. `lastlog` This formats and prints the contents of the last login log `/var/log/lastlog` file. + + *Example*__To view last login time of user bob:__ + + `$ lastlog -u bob` + `Username Port From Latest` + `dave pts/7 server1.example Mon May 5 14:36:52 -0400 2014` + +# Track successful/failed login attempts # + +1. Login attempts are stored in `/var/log/secure` and this file can be checked. + +`# less /var/log/secure | grep bob` + +`May 18 14:56:17 lab1 unix_chkpwd[17490]: password check failed for user (bob)` +`May 18 14:56:17 lab1 sshd[17489]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=server1.example.com user=bob` +`May 18 14:56:18 lab1 sshd[17481]: Accepted keyboard-interactive/pam for bob from 192.168.0.25 port 60735 ssh2` +`May 18 14:56:18 lab1 sshd[17481]: pam_unix(sshd:session): session opened for user bob by (uid=0)` +`May 18 16:50:04 lab1 unix_chkpwd[19626]: password check failed for user (bob)` +`May 18 16:50:04 lab1 sudo: pam_unix(sudo:auth): authentication failure; logname=bob uid=0 euid=0 tty=/dev/pts/12 ruser= rhost= user=bob` +`May 18 16:50:04 lab1 sudo: bob : TTY=pts/12 ; PWD=/home/bob ; USER=root ; COMMAND=/bin/su -` +`May 18 16:50:04 lab1 su: pam_unix(su-l:session): session opened for user root by bob(uid=0)` + +2. Collect authentication reports for all recent attempts made on the system. + + *Example*__Reports for all attempts:__ + +`# aureport -au -i` + +`Authentication Report` +`============================================` +`# date time acct host term exe success event` +`============================================` +`1. 05/16/14 10:12:54 bob ? /dev/pts/116 /usr/bin/sudo yes 6946469` +`2. 05/16/14 12:09:19 jeff ? /dev/pts/117 /usr/bin/sudo yes 6947443` +`3. 05/16/14 12:16:11 jeff ? /dev/pts/102 /usr/bin/sudo yes 6947512` +`4. 05/16/14 13:00:10 bob ? /dev/pts/116 /usr/bin/sudo yes 6947866` + + *Example*__Reports for successful attempts:__ + +`# aureport -au -i --success` + +`Authentication Report` +`============================================` +`# date time acct host term exe success event` +`============================================` +`1. 05/16/14 10:12:54 bob ? /dev/pts/116 /usr/bin/sudo yes 6946469` +`2. 05/16/14 12:09:19 jeff ? /dev/pts/117 /usr/bin/sudo yes 6947443` +`3. 05/16/14 12:16:11 jeff ? /dev/pts/102 /usr/bin/sudo yes 6947512` +`4. 05/16/14 13:00:10 bob ? /dev/pts/116 /usr/bin/sudo yes 6947866` + + *Example*__Reports for failed attempts:__ + +`# aureport -au -i --failed` + +`Authentication Report` +`============================================` +`# date time acct host term exe success event` +`============================================` +`1. 05/16/14 15:42:11 dave ? /dev/pts/124 /usr/bin/sudo no 6949322` +`2. 05/17/14 12:02:53 andy 10.10.10.26 ssh /usr/sbin/sshd no 6959885` +`3. 05/18/14 01:21:06 abhay ? /dev/pts/12 /usr/bin/sudo no 6967954` + + *Example*__Login Failures:__ + +`# aureport -l --failed` + +`Login Report` +`============================================` +`# date time auid host term exe success event` +`============================================` +`1. 05/16/14 21:50:22 pete 10.191.29.164 sshd /usr/sbin/sshd no 6952386` +`2. 05/17/14 12:02:09 andy 10.10.10.26 sshd /usr/sbin/sshd no 6959875` +`3. 05/17/14 12:02:48 andy 10.10.10.26 sshd /usr/sbin/sshd no 6959884` + + *Example*__Successful Logins:__ + +`# aureport -l --success` + +`Login Report` +`============================================` +`# date time auid host term exe success event` +`============================================` +`1. 05/16/14 21:50:22 42771 10.191.29.164 sshd /usr/sbin/sshd yes 6952386` +`2. 05/17/14 12:02:09 34566 10.10.10.26 sshd /usr/sbin/sshd yes 6959875` +`3. 05/17/14 12:02:48 34566 10.10.10.26 sshd /usr/sbin/sshd yes 6959884` + + *Example*__Login Summary Report:__ + +`# aureport -l --success --summary -i` + +`Success Login Summary Report` +`============================================` +`total auid` +`============================================` +`4 alison` +`4 alex` +`3 andy` +`2 suzanne` +`1 paul` +`1 dave` +`1 pete` +`1 rashmi` + +##Refs:## +1. https://www.golinuxhub.com/2014/05/how-to-check-last-login-time-for-users.html +2. https://www.golinuxhub.com/2014/05/how-to-track-all-successful-and-failed.html diff --git a/vimwiki/Cluster SysAdmin Notes.md b/vimwiki/Cluster SysAdmin Notes.md new file mode 100644 index 0000000..1a40361 --- /dev/null +++ b/vimwiki/Cluster SysAdmin Notes.md @@ -0,0 +1,29 @@ +__Cluster sysadmin notes__ + +These notes are intended to be a living document which records common sysadmin activities on the cluster. At some point we may add some structure rather than just a big brain dump... + +[Login For Administration](Login For Administration) + +[User Creation ](User Creation ) + +[Password Changing](Password Changing) + +[User Deletion](User Deletion) + +[Changing a User's shell](Changing a User's shell) + +[Jobs](Jobs) + +[Blocked IP Addresses](Blocked IP Addresses) + +[Quota Problems](Quota Problems) + +[Backup](Backup) + +[Nodes](Nodes) + +[Servers](Servers) + +[Ansys](Ansys) + + diff --git a/vimwiki/Email Settings.md b/vimwiki/Email Settings.md new file mode 100644 index 0000000..b4dda3a --- /dev/null +++ b/vimwiki/Email Settings.md @@ -0,0 +1,34 @@ + +##Sending via SMTP## + +To send emails using Office365 server enter these details:__ + + __SMTP Host:__ smtp.office365.com + __SMTP Port:__ 587 + __SSL Protocol:__ OFF + __TLS Protocol:__ ON + __SMTP Username:__ (UH username) + __SMTP Password:__ (UH password) + + +##POP3 Fetching## + +To receive emails from Office365 using POP3 + + __POP3 Host:__ outlook.office365.com + __POP3 Port:__ 995 + __TLS Protocol:__ ON + __POP3 Username:__ (UH username) + __POP3 Password:__ (UH password) + + +##IMAP Fetching## + +To receive emails from Office365 using IMAP + + __IMAP Host:__ outlook.office365.com + __IMAP Port:__ 993 + __Encryption:__ SSL + __IMAP Username:__ (UH username) + __IMAP Password:__ (UH password) + diff --git a/vimwiki/Examples.md b/vimwiki/Examples.md new file mode 100644 index 0000000..fa3b5a2 --- /dev/null +++ b/vimwiki/Examples.md @@ -0,0 +1,282 @@ + +##1. Copy SSH public key on a remote machine for passwordless login:## + + `ssh-copy-id user@host` + + To generate the keys use the command ssh-keygen + + +##2. Start a tunnel from some machine’s port 80 to your local post 2001:## + + `ssh -N -L2001:localhost:80 somemachine` + + Now you can acces the website by going to http://localhost:2001/ + +##3. Output your microphone to a remote computer’s speaker## + + `dd if=/dev/dsp | ssh -c arcfour -C username@host dd of=/dev/dsp` + This will output the sound from your microphone port to the ssh target computer’s + speaker port. The sound quality is very bad, so you will hear a lot of hissing. + +##4. Compare a remote file with a local file## + + `ssh user@host cat /path/to/remotefile | diff /path/to/localfile –` + + Useful for checking if there are differences between local and remote files. + +##5. Mount folder/filesystem through SSH## + + `sshfs name@server:/path/to/folder /path/to/mount/point` + + Install SSHFS from http://fuse.sourceforge.net/sshfs.html + Will allow you to mount a folder security over a network. + +##6. SSH connection through host in the middle## + + `ssh -t reachable_host ssh unreachable_host` + + Unreachable_host is unavailable from local network, but it’s available + from reachable_host’s network. This command creates a connection to + unreachable_host through “hidden” connection to reachable_host. Of + course you need to be able to access reachable_host for this. + +##7. Copy from host1 to host2, through your host## + + `ssh root@host1 “cd /somedir/tocopy/ && tar -cf – .” | ssh root@host2 “cd /samedir/tocopyto/ && tar -xf -“` + + Good if only you have access to host1 and host2, but they have no + access to your host (so ncat won’t work) and they have no direct + access to each other. + +##8. Run any GUI program remotely## + + `ssh -fX <user>@<host> <program>` + + The SSH server configuration requires: + + `X11Forwarding yes # this is default in Debian` + + And it’s convenient too: + + `Compression delayed` + +##9. Attach screen over ssh## + + `ssh -t remote_host screen -r` + + Directly attach a remote screen session (saves a useless parent bash process) + +##10. Create a persistent connection to a machine## + + `ssh -MNf <user>@<host>` + + Create a persistent SSH connection to the host in the background. Combine + this with settings in your ~/.ssh/config: + + `Host host` + `ControlPath ~/.ssh/master-%r@%h:%p` + `ControlMaster no` + + All the SSH connections to the machine will then go through the persisten SSH + socket. This is very useful if you are using SSH to synchronize files (using + rsync/sftp/cvs/svn) on a regular basis because it won’t create a new socket + each time to open an ssh connection. + +##11. Port Knocking!## + + `knock <host> 3000 4000 5000 && ssh -p <port> user@host && knock <host> 5000 4000 3000` + + Knock on ports to open a port to a service (ssh for example) and knock again to close + the port. You have to install knockd. + + See example config file below. + + `[options]` + `logfile = /var/log/knockd.log` + `[openSSH]` + `sequence = 3000,4000,5000` + `seq_timeout = 5` + `command = /sbin/iptables -A INPUT -i eth0 -s %IP% -p tcp –dport 22 -j ACCEPT` + `tcpflags = syn` + `[closeSSH]` + `sequence = 5000,4000,3000` + `seq_timeout = 5` + `command = /sbin/iptables -D INPUT -i eth0 -s %IP% -p tcp –dport 22 -j ACCEPT` + `tcpflags = syn` + +##12. Remove a line in a text file. Useful to fix “ssh host key change” warnings## + + `ssh-keygen -R <the_offending_host>` + + In this case it’s better do to use the dedicated tool + +##13. Remove a line in a text file. Useful to fix “ssh host key change” warnings## + + `sed -i 8d ~/.ssh/known_hosts` + +##14. Run complex remote shell cmds over ssh, without escaping quotes## + + `ssh host -l user $(<cmd.txt)` + + Much simpler method. More portable version: ssh host -l user “`cat cmd.txt`” + +##15. Copy a MySQL Database to a new Server via SSH with one command## + + `mysqldump –add-drop-table –extended-insert –force –log-error=error.log -uUSER -pPASS OLD_DB_NAME | ssh -C user@newhost “mysql -uUSER -pPASS NEW_DB_NAME”` + + Dumps a MySQL database over a compressed SSH tunnel aand uses it as input to mysql + – i think that is the fastest and best way to migrate a DB to a new server! + +##16. Copy your ssh public key to a server from a machine that doesn’t have ssh-copy-id## + + `cat ~/.ssh/id_rsa.pub | ssh user@machine “mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys”` + + If you use Mac OS X or some other *nix variant that doesn’t come with ssh-copy-id, + this one-liner will allow you to add your public key to a remote machine so you can + subsequently ssh to that machine without a password. + + +##17. Live ssh network throughput test## + + ` yes | pv | ssh $host “cat > /dev/null”` + + connects to host via ssh and displays the live transfer speed, directing all transferred data to /dev/null + needs pv installed + + Debian: `‘apt-get install pv’` + Fedora: `‘yum install pv’` (may need the ‘extras’ repository enabled) + Opensuse: `zypper install pv` + +##18. How to establish a remote Gnu screen session that you can re-connect to## + + `ssh -t user@some.domain.com /usr/bin/screen -xRR` + + Long before tabbed terminals existed, people have been using Gnu screen to open many shells in a single text + terminal. Combined with ssh, it gives you the ability to have many open shells with a single remote + connection using the above options. If you detach with “Ctrl-a d” or if the ssh session is accidentally + terminated, all processes running in your remote shells remain undisturbed, ready for you to reconnect. + Other useful screen commands are “Ctrl-a c” (open new shell) and “Ctrl-a a” (alternate between shells). + Read this quick reference for more screen commands: http://aperiodic.net/screen/quick_reference + +##19. Resume scp of a big file## + + `rsync –partial –progress –rsh=ssh $file_source $user@$host:$destination_file` + + It can resume a failed secure copy ( usefull when you transfer big files like db dumps through vpn ) using rsync. + It requires rsync installed in both hosts. + + `rsync –partial –progress –rsh=ssh $file_source $user@$host:$destination_file local` -> remote + or + `rsync –partial –progress –rsh=ssh $user@$host:$remote_file $destination_file remote` -> local + +##20. Analyze traffic remotely over ssh w/ wireshark## + + `ssh root@server.com ‘tshark -f “port !22” -w -‘ | wireshark -k -i –` + + This captures traffic on a remote machine with tshark, sends the raw pcap data over the ssh link, + and displays it in wireshark. Hitting ctrl+C will stop the capture and unfortunately close your + wireshark window. This can be worked-around by passing -c # to tshark to only capture a certain # + of packets, or redirecting the data through a named pipe rather than piping directly from ssh to + wireshark. I recommend filtering as much as you can in the tshark command to conserve bandwidth. + tshark can be replaced with tcpdump thusly: + + `ssh root@example.com tcpdump -w – ‘port !22’ | wireshark -k -i –` + +##21. Have an ssh session open forever## + + `autossh -M50000 -t server.example.com ‘screen -raAd mysession’` + + Open a ssh session opened forever, great on laptops losing Internet connectivity when switching WIFI spots. + +##22. Harder, Faster, Stronger SSH clients## + + `ssh -4 -C -c blowfish-cbc` + + We force IPv4, compress the stream, specify the cypher stream to be Blowfish. I suppose you could use + aes256-ctr as well for cypher spec. I’m of course leaving out things like master control sessions and + such as that may not be available on your shell although that would speed things up as well. + +##23. Throttle bandwidth with cstream## + + `tar -cj /backup | cstream -t 777k | ssh host ‘tar -xj -C /backup’` + + this bzips a folder and transfers it over the network to “host” at 777k bit/s. + cstream can do a lot more, have a look http://www.cons.org/cracauer/cstream.html#usage + for example: + + `echo w00t, i’m 733+ | cstream -b1 -t2` + +##24. Transfer SSH public key to another machine in one step## + + `ssh-keygen; ssh-copy-id user@host; ssh user@host` + + This command sequence allows simple setup of (gasp!) password-less SSH logins. Be careful, as if you + already have an SSH keypair in your ~/.ssh directory on the local machine, there is a possibility + ssh-keygen may overwrite them. ssh-copy-id copies the public key to the remote host and appends it to + the remote account’s ~/.ssh/authorized_keys file. When trying ssh, if you used no passphrase for your key, + the remote shell appears soon after invoking ssh user@host. + +##25. Copy stdin to your X11 buffer## + + `ssh user@host cat /path/to/some/file | xclip` + + Have you ever had to scp a file to your work machine in order to copy its contents to a mail? xclip can help + you with that. It copies its stdin to the X11 buffer, so all you have to do is middle-click to paste the + content of that looong file :) + +##26. Synchronize date and time with server over ssh## + + `date --set="$(ssh user@server date)"` + + NTP is better, but there are situations where it can’t be used. In those cases, you can do this to + sync the local time to a server. + +##27. Duplicate installed packages from one machine to the other## + + `ssh root@remote.host "rpm -qa" | xargs yum -y install` + + This will duplicate installed packages from one machine to the other – works for rpm/yum based systems. + + The next one works for Ubuntu/Debian based systems. + + Tell local Debian machine to install packages used by remote Debian machine + + `ssh remotehost 'dpkg --get-selections' | dpkg --set-selections && dselect install` + + (also works on Ubuntu) Copies the ‘install,’ ‘hold,’ ‘deinstall’ and ‘purge’ states of packages on the + remote machine to be matched on the local machine. Note: if packages were installed on the local + machine that were never installed on the remote machine, they will not be deinstalled by this operation. + + `apt-get install ssh root@host_you_want_to_clone "dpkg -l | grep ii" | awk '{print $2}'` + + “Clone” a list of installed packages from one Debian/Ubuntu Server to another + +##28. Backup a remote database to your local filesystem## + + `ssh user@host 'mysqldump dbname | gzip' > /path/to/backups/db-backup-`date +%Y-%m-%d`.sql.gz` + + I have this on a daily cronjob to backup the commandlinefu.com database from NearlyFreeSpeech.net + (awesome hosts by the way) to my local drive. Note that (on my Ubuntu system at least) you need to + escape the % signs on the crontab. + +##29. run command on a group of nodes in parallel## + + `echo "uptime" | pee "ssh host1" "ssh host2" "ssh host3"` + + `echo "uptime" | tee >(ssh host1) >(ssh host2) >(ssh host3)` + + The pee command is in the moreutils package. + +##30. ssh to machine behind shared NAT## + + `ssh -NR 0.0.0.0:2222:127.0.0.1:22 user@jump.host.com` + + Useful to get network access to a machine behind shared IP NAT. Assumes you have an accessible jump + host and physical console or drac/ilo/lom etc access to run the command. + + Run the command on the host behind NAT then ssh connect to your jump host on port 2222. That + connection to the jump host will be forwarded to the hidden machine. + + Note: Some older versions of ssh do not acknowledge the bind address (0.0.0.0 in the example) + and will only listen on the loopback address. + diff --git a/vimwiki/Extras.md b/vimwiki/Extras.md new file mode 100644 index 0000000..df7776a --- /dev/null +++ b/vimwiki/Extras.md @@ -0,0 +1,12 @@ +## Extras ## + + | ------------------------------------------------------------------------------- | + | App Name | ipk | + | ------------------------------------------------------------------------------- | + | Sim Toolkit | - | + | Maps | - | + | Dictionary | com.hamptoncatlin.dictionary.free_1.1.1_all.ipk | + | 10 knots | com.clearwater.knots_1.0.0_all.ipk | + | Bills Vs Income Free | com.machiapps.billsvsincomefree_2.0.1_all.ipk | + | Buzzer | com.digitalpowers.buzzer_1.0.0_all.ipk | + | ------------------------------------------------------------------------------- | diff --git a/vimwiki/Firefox.md b/vimwiki/Firefox.md new file mode 100644 index 0000000..3c5f198 --- /dev/null +++ b/vimwiki/Firefox.md @@ -0,0 +1,27 @@ +# Privacy Security Settings # + +A lot of these settings can be found in the excellent ArchWiki +article at [[https://wiki.archlinux.org/index.php/Firefox/Privacy#Configuration_tweaks|Firefox Privacy settings link]] + + +## Change user agent and platform ## + +To change the user agent in firefox, add the following string key in *about:config:* + +_general.useragent.override_ + +The value for the key is your browser's user agent. Select a known common one. + +*Tip:* _The value Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0_ is used as the user agent for the Tor browser, thus being very common. + +_*Warning: Changing the user agent without changing to a corresponding platform will make your browser nearly unique.*_ + +To change the platform for firefox, add the following string key in *about:config:* + +_general.platform.override_ + +Select a known common platform that corresponds with your user agent. + +*Tip:* _The value Win32 is used as the platform for the Tor browser, corresponding with the user agent provided above._ + + diff --git a/vimwiki/Forwarding a message with attachments.md b/vimwiki/Forwarding a message with attachments.md new file mode 100644 index 0000000..b0df7ee --- /dev/null +++ b/vimwiki/Forwarding a message with attachments.md @@ -0,0 +1,23 @@ + +To forward a message in mutt including all it's attachments, you can set the +variable `mime_forward` as follows: + +`set mime_forward` +`set mime_forward_rest=yes` + +This however forwards all headers, attachments etc as +a single attachment. + +A similar approach happens if you type `b`. This bounces the message completely +unmodified to a new address. +However, using the above two methods there is no way to trim the message. + +Instead you can try: + +1. type `v` to get to the attachments screen, and then type `t` repeatedly + to tag the required attachments and then type `;f` to forward the tagged + attachments. +2. Use the template method - type `Esc e` to resend the message using the + current message as a template. + + diff --git a/vimwiki/GRADNet.md b/vimwiki/GRADNet.md new file mode 100644 index 0000000..cb8ca07 --- /dev/null +++ b/vimwiki/GRADNet.md @@ -0,0 +1,4 @@ + +[Characterising Exoplanets: Theory and Data Driven perspectives](Characterising Exoplanets: Theory and Data Driven perspectives) + + diff --git a/vimwiki/Games.md b/vimwiki/Games.md new file mode 100644 index 0000000..5669aaf --- /dev/null +++ b/vimwiki/Games.md @@ -0,0 +1,13 @@ +## Games ## + + |----------------|----------------------------------------| + | App Name | ipk | + |----------------|----------------------------------------| + | Sparkle | com.10tons.app.sparkle_1.0.0_all.ipk | + | Sparkle2 | com.10tons.sparkle2_1.0.1.ipk | + | ZOPP | com.btg.zopp_0.0.6_all.ipk | + | Azkend | com.10tons.app.azkend_1.2.1_all.ipk | + | Azkend2 | com.10tons.azkend2_1.1.0_all.ipk | + | Dungeon Scroll | com.rtsoft.app.rtdscroll_1.0.4_all.ipk | + |----------------|----------------------------------------| + diff --git a/vimwiki/HardDrives.md b/vimwiki/HardDrives.md new file mode 100644 index 0000000..1ee104f --- /dev/null +++ b/vimwiki/HardDrives.md @@ -0,0 +1,6 @@ +[Replacing A Failed Disk in a mdadm RAID](Replacing A Failed Disk in a mdadm RAID) + +[SMARTCTL](SMARTCTL) + + + diff --git a/vimwiki/IC and STRI Displays .md b/vimwiki/IC and STRI Displays .md new file mode 100644 index 0000000..611a8de --- /dev/null +++ b/vimwiki/IC and STRI Displays .md @@ -0,0 +1,47 @@ +#The IC and STRI displays# + +These run a slideshow based on web pages that are +stored in: + +`/www/display` on `star` -- namely, + +`/www/display/ic-display.herts.ac.uk` and `/www/display/stri-display.herts.ac.uk` + +##To add or remove content.## + +Create a web page under these directories and then edit `opentabs.html` +which tells the web browser running on the PIs which tabs to open. + +Examples of pages which just display an image are `seminar.html` or +`swipe.html` -- they just display the corresponding large pngs. + +e.g. if asked to advertise a seminar, copy the png file provided by +the seminar organizer to this location, include `seminar.html` in the +list of files to open in `opentabs.html`, and reboot the pi. + +If someone sends something in another format, convert +it to a PNG and then include it in a blank webpage. + +The research images are generated from a flickr image set originated +by Hugh Jones. Username `stristri@yahoo.com`, password `al109abal109ab`. +Upload new photos to the albums there and they will be picked up +by the displays. + +##Raspberry Pis## + +###SSH Access### + +The raspberry pis are on the internet as `ic-display.herts.ac.uk` and +`stri-display.herts.ac.uk`. The username is `pi` and the password is the +standard admin password beginning with r. The only reason to log into +them is to reboot them, e.g. if there are new pages to display. +Log in with ssh and type `reboot`. This will prompt you for the +password again. + +###Powering On and Off### + +Switch the IC display off when leaving on a Friday night and +back on again on a Monday morning. +The control button is on the bottom right of the TV. For more +complex control requirements there's a remote control in Martins's office. + diff --git a/vimwiki/IDL.md b/vimwiki/IDL.md new file mode 100644 index 0000000..6c29df4 --- /dev/null +++ b/vimwiki/IDL.md @@ -0,0 +1,5 @@ +[Install On Linux-MacOSX From A Shell Script](Install On Linux-MacOSX From A Shell Script) + +[Install On MacOSX From A .pkg File](Install On MacOSX From A .pkg File) + +[Manage Licenses From The License Administrator Tool](Manage Licenses From The License Administrator Tool) diff --git a/vimwiki/Install On Linux-MacOSX From A Shell Script.md b/vimwiki/Install On Linux-MacOSX From A Shell Script.md new file mode 100644 index 0000000..4ad90a0 --- /dev/null +++ b/vimwiki/Install On Linux-MacOSX From A Shell Script.md @@ -0,0 +1,24 @@ +1. Unpack and uncompress the files: + + Uncompress the `filename.tar.gz` archive file that was downloaded to your computer, then unpack the file: + + `$ tar -xvf filename.tar.gz` + +2. Start the installer: + `$ ./install.sh` + +3. Follow the prompts to install the software. + +4. When installation is complete, license the software. + To activate node-locked licenses to a specific user and computer, + see [[Manage Licenses From The License Administrator Tool]] for steps. + +5. From a terminal window, change directories to `$INSTALL_DIR/idlxx/bin`. + Enter a command at the shell prompt to start an application: + + `idl` - Start command-line IDL. + + `idlde` - Start the IDL Development Environment. + + `idlhelp` - Start IDL Help. + diff --git a/vimwiki/Install On MacOSX From A .pkg File.md b/vimwiki/Install On MacOSX From A .pkg File.md new file mode 100644 index 0000000..08b2651 --- /dev/null +++ b/vimwiki/Install On MacOSX From A .pkg File.md @@ -0,0 +1,12 @@ +1. Start the installer: + Navigate to the `idlxx-mac.pkg` file that was downloaded to your computer and run it. + +2. Follow the prompts to install the software. + +3. When installation is complete, license the software. + To activate node-locked licenses to a specific user and computer, + see [[Manage Licenses From The License Administrator Tool]] for steps. + +4. From the Mac Finder, go to `$INSTALL_DIR/idlxx` and double-click `IDLx.x` to launch IDL. + + diff --git a/vimwiki/Internet.md b/vimwiki/Internet.md new file mode 100644 index 0000000..da68daa --- /dev/null +++ b/vimwiki/Internet.md @@ -0,0 +1,18 @@ +## Internet ## + + |----------------------|------------------------------------------| + | App Name | ipk | + |----------------------|------------------------------------------| + | Plogger | gworley3.plogger_1.0.1_all.ipk | + | Explorer for Dropbox | de.pcworldsoftware.dropbox_1.0.3_all.ipk | + | Hi SkyDrive | com.talign.skydrive_1.0.5.ipk | + | Relego | com.webosroundup.relego_0.3.1_all.ipk | + | Wapedia | com.taptu.wapedia.webos_1.0.2_all.ipk | + | wikiHow | com.wikihow.wikihowapp_0.9.6_all.ipk | + | FTPit! | de.pcworldsoftware.ftpit_1.1.1_all.ipk | + | Tor Browser | | + | bit.ly | de.echooff.mojo.bitly_1.0.2_all.ipk | + | GPS Fix | com.jamesharris.gpsfix_2.0.01_all.ipk | + |----------------------|------------------------------------------| + + diff --git a/vimwiki/Jobs.md b/vimwiki/Jobs.md new file mode 100644 index 0000000..de7fdbe --- /dev/null +++ b/vimwiki/Jobs.md @@ -0,0 +1,16 @@ +You can use the standard `qstat` command as described in the wiki to see what jobs are running. However, +more information is given by looking at the scheduler’s status. On the main head node, you can run +`showq` which gives the scheduler’s view of the queue. `sudo showstate` will give you a view of node usage. + +If you need to view an individual job belonging to another user you can do + +`sudo checkjob 123456` (where 123456 is the number of the job). + +This should tell you what nodes it is running on or why it is not +running. + +You can change the requirements of a job (e.g. walltime) with + +`sudo qalter –l …. 123456` + + diff --git a/vimwiki/Jokes.md b/vimwiki/Jokes.md new file mode 100644 index 0000000..ba6bfe4 --- /dev/null +++ b/vimwiki/Jokes.md @@ -0,0 +1,203 @@ + +*Where does the General keep his armies?* `In his sleevies.` + +*How does a squid go into battle?* `Well-armed.` + +*What's the best thing about Switzerland?* `I don't know, but their flag is a` +`huge plus.` + +*Where do you find a cow with no legs?* ` Right where you left it. ` + +*Why aren't koalas actual bears?* ` They don't meet the koalafications. ` + +`A bear walks into a restaurant. He tells his waiter, "I want a grilled …. cheese."` +`The waiter says, "What's with the pause?" "Whaddya mean?" the bear replies. "I'm a bear!" ` + +*What's E.T. short for?* `Because he's only got little legs.` + +*What do you call a Frenchman wearing sandals?* `Phillipe Phillope.` + +`Never criticize someone until you have walked a mile in their shoes. That` +`way, when you criticize them, you'll be a mile away, and you'll have their` +`shoes.` + +`Two men meet on opposite sides of a river. One shouts to the other, "I` +`need you to help me get to the other side!" The other guy replies, "You're` +`on the other side!"` + +*What's the difference between a hippo and a zippo?* `One is really heavy,` +`and the other is a little lighter.` + +*What do Alexander the Great and Winnie the Pooh have in common?* +`Same middle name.` + +*What did the mayonnaise say when the refrigerator door was opened?* +`Close the door, I'm dressing.` + +`"I stand corrected!" Said the man in the orthopedic shoes.` + +`I used to be addicted to soap. But I'm clean now.` + +*What did the left eye say to the right eye?* +`Between you and me, something smells.` + +*Why is England the wettest country?* +`Because the queen has reigned there for years.` + +`It's hard to explain puns to kleptomaniacs. They always take things so literally.` + +*What do you call it when Batman skips church?* +`Christian Bale.` + +`A guy goes to a pet store to buy a goldfish. The salesman asks him, "Do` +`you want an aquarium?" The guy responds, "I don't care what star sign it` +`is!"` + +*What do you call bears with no ears?* +`B–` + +*What's a foot long and slippery?* +`A slipper.` + +`Exaggerations have become an epidemic. They went up by a million percent` +`last year.` + +`And God said to John, "Come forth and you shall be granted eternal life."` +`But John came fifth and won a toaster.` + +`I want to die peacefully in my sleep like my grandfather did. Not` +`screaming in terror like the passengers in his car.` + +*What's the difference between a golfer and a skydiver?* +`A golfer goes *whack* "darn" and a skydiver goes "darn" *whack*.` + +`They all laughed when I said I wanted to be a comedian. Well, they're not` +`laughing now!` + +`Two cows are grazing in a field. One cow says to the other, "You ever` +`worry about that mad cow disease?" The other cow says, "Why would I care?` +`I'm a helicopter!"` + +`I told my physical therapist that I broke my arm in two places. He told me` +`to stop going to those places.` + +*What did the swordfish say to the marlin?* +`You're looking sharp.` + +*How do you make holy water?* +`You boil the hell out of it.` + +*Will glass coffins be a success?* +`Remains to be seen.` + +`I was wondering why the ball was getting bigger. Then it hit me.` + +`Two windmills are standing in a wind farm. One asks, "What's your favorite` +`kind of music?" The other says, "I'm a big metal fan."` + +*What's the difference between a hippo and a zippo?* +`One is really heavy and the other is a little lighter.` + +*Did you hear about the guy whose whole left side was cut off?* +`He's all right now.` + +*What do you call a bee that can't make up its mind?* +`A maybe.` + +*Hear about the new restaurant called Karma?* +`There's no menu—you get what you deserve.` + +*What did the janitor say when he jumped out of the closet?* +`SUPPLIES!` + +*Is it ignorance or apathy that's destroying the world today?* +`I don't know and don't really care.` + +*What do you call the wife of a hippie?* +`A Mississippi.` + +------ + +I bought some shoes from a drug dealer. I don't know what he laced them with, but I've been tripping all day. + +I told my girlfriend she drew her eyebrows too high. She seemed surprised. + +My dog used to chase people on a bike a lot. It got so bad, finally I had to take his bike away. + +My boss told me to have a good day.. so I went home. + +Why is Peter Pan always flying? He neverlands. + +A woman walks into a library and asked if they had any books about paranoia. The librarian says "They're right behind you!" + +The other day, my wife asked me to pass her lipstick but I accidentally passed her a glue stick. She still isn't talking to me. + +My friend says to me: "What rhymes with orange" I said: "No it doesn't" + +What do you call a guy with a rubber toe? Roberto. + +My wife told me I had to stop acting like a flamingo. So I had to put my foot down. + +I couldn't figure out why the baseball kept getting larger. Then it hit me. + +Why did the old man fall in the well? Because he couldn't see that well. + +I ate a clock yesterday, it was very time consuming. + +Whatdya call a frenchman wearing sandals? Phillipe Phillope. + +I know a lot of jokes about unemployed people but none of them work. + +What's orange and sounds like a parrot? A carrot. + +Did you hear about the italian chef that died? He pasta way. + +Why couldn't the bicycle stand up? Because it was two tired! + +Parallel lines have so much in common. It’s a shame they’ll never meet. + +Where do you find a cow with no legs? Right where you left it. + +When a deaf person sees someone yawn do they think it’s a scream? + +As I suspected, someone has been adding soil to my garden. The plot thickens. + +And the lord said unto John, "Come forth and you will receive eternal life". John came fifth and won a toaster. + +Why wouldn’t the shrimp share his treasure? Because he was a little shellfish. + +What did the left eye say to the right eye? Between you and me, something smells. + +Did you hear about the kidnapping in the park? They woke him up. + +I think i would like a job cleaning mirrors, it's just something I could really see myself doing. + +I took the shell off my racing snail thinking it would make him go faster, if anything it made him more sluggish. + +Just remember - you never really completely useless, you can always serve as a bad example. + +--------------------------------------------- + +Q: What goes up and down but does not move? +A: Stairs + +Q: What do you call a boy named Lee that no one talks to? +A: Lonely + +Q: What gets wetter the more it dries? +A: A towel. + +Q: Why do bicycles fall over? +A: Because they are two-tired! + +Q: What did Cinderella say when her photos did not show up? +A: Someday my prints will come! + +Q: Why was the broom late? +A: It over swept! + +Q: Why can't your nose be 12 inches long? +A: Because then it would be a foot! + +Q: Why do eskimos do their laundry in Tide? +A: Because it's too cold out-tide! diff --git a/vimwiki/Just For Fun.md b/vimwiki/Just For Fun.md new file mode 100644 index 0000000..ba381c7 --- /dev/null +++ b/vimwiki/Just For Fun.md @@ -0,0 +1,13 @@ +## Just For Fun ## + + |------------------------------------|-------------------------------------------------------| + | App Name | ipk | + |------------------------------------|-------------------------------------------------------| + | AudioScape | com.thing10.audioscape_1.0.11_all.ipk | + | ESFx | com.zakzo.app.esfx_0.9.6_all.ipk | + | RimShot | com.kissaham.rimshot_0.2.4_all.ipk | + | Star Trek Communicator | com.worldofnatecom.startrekcommunicator_1.5.1_all.ipk | + | Chuck | com.pdm.chuck_1.0.0_all.ipk | + | Custom Soundboard | com.blogspot.bodhisoft.csb_1.0.6_all.ipk | + |------------------------------------|-------------------------------------------------------| + diff --git a/vimwiki/Kali.md b/vimwiki/Kali.md new file mode 100644 index 0000000..ce77dd8 --- /dev/null +++ b/vimwiki/Kali.md @@ -0,0 +1,16 @@ + + ## Kali Linux 2.0 ## + +Notes: + +If you enter a login loop, then press ** ctrl-alt f1,2,3,4,5, ** or ** 6 ** to get a console login. +Login as root and enter __dpkg --configure -a__. +Select any defaults offered and then reboot. + +### Network ### + +** Network Adapter ** This VM has a number of network adapters so that it can communicate with the + other VM's on host only private networks. However by default the first network adapter is automatically + started and set to Bridged mode so that this VM can communicate wth the outside world, for updates etc. + This can be changed prior to launching this vm in the network editor and assigned to one of the other + host only network adaptors. diff --git a/vimwiki/Kids.md b/vimwiki/Kids.md new file mode 100644 index 0000000..2ad0e9b --- /dev/null +++ b/vimwiki/Kids.md @@ -0,0 +1,25 @@ +## Kids ## + + |----------------------|-----------------------------------------------| + | App Name | ipk | + |----------------------|-----------------------------------------------| + | Angry Birds | com.rovio.angrybirds_1.5.1.ipk | + | Angry Birds Seasons | com.rovio.angrybirdsseasons_1.6.0_all.ipk | + | Angry Birds Rio | com.rovio.angrybirdsrio_1.3.2_all.ipk | + | Pow Fish | com.livingmidnight.powfish_1.3.0_all.ipk | + | Ancient Frog | com.ancient-workshop.frogle_1.19.7_all.ipk | + | Cloud Hopper | com.asc.rc.cloudhopper_1.5.2_all.ipk | + | Ninja Camp | caffeina.games.ninjacamp_1.0.2_all.ipk | + | Lilly Tube Ultimate | com.pixilabs.lillytubeultimate_1.0.1.ipk | + | Spinballs Lite | com.christiangross.spinballs_1.1.0_all.ipk | + | Snake Slider | com.bdrgames.snakeslider_1.5.3_all.ipk | + | Glow Hockey Free | com.natenai.app.glowhockey_2.2.10_all.ipk | + | Caveman | com.mobile1up.caveman-lite_1.2.3_all.ipk | + | BeamOut Free | com.underclouds.app.beamoutfree_1.0.8_all.ipk | + | Quell HD | com.underclouds.app.beamoutfree_1.0.8_all.ipk | + | Bubbles | com.thomasschoeps.app.bubbbles_1.5.2_all.ipk | + | Ground Effect Pro HD | com.jakyl.gepro_1.6.2_all.ipk | + | Radiant Lite | net.hexage.radiant.lite_2.12.34_all.ipk | + |----------------------|-----------------------------------------------| + + diff --git a/vimwiki/Lectures.md b/vimwiki/Lectures.md new file mode 100644 index 0000000..881700f --- /dev/null +++ b/vimwiki/Lectures.md @@ -0,0 +1,2 @@ +[GRADNet](GRADNet) + diff --git a/vimwiki/Libcrypto segfault automount.md b/vimwiki/Libcrypto segfault automount.md new file mode 100644 index 0000000..3f65fbc --- /dev/null +++ b/vimwiki/Libcrypto segfault automount.md @@ -0,0 +1,10 @@ +On new builds if there are problems with libcrypto segfault, +do the following: + +1. Cat /etc/selinux/config --- make sure selinux is disabled. +2. yum downgrade krb5_workstation, krb5-libs, libkadm5, krb5-devel + + + + + diff --git a/vimwiki/Linking.md b/vimwiki/Linking.md new file mode 100644 index 0000000..1146457 --- /dev/null +++ b/vimwiki/Linking.md @@ -0,0 +1,10 @@ + +## Symbolic Linker ## + +If you create a symbolic link to a file/directory and then change it's location, +instead of deleting and then creating a new link, the link can be updated as follows: + +**Creation:** `ln -s /path/to/file-name link-name` + +**Update:** `ln -sfn /path/to/file-name link-name` + diff --git a/vimwiki/LinuxAdmin.md b/vimwiki/LinuxAdmin.md new file mode 100644 index 0000000..79f7937 --- /dev/null +++ b/vimwiki/LinuxAdmin.md @@ -0,0 +1,39 @@ + +[Bluetooth](Bluetooth) + +[Browsers](Browsers) + +[conky](conky) + +[HardDrives](HardDrives) + +[IDL](IDL) + +[Linking](Linking) + +[Login](Login) + +[Mutt](Mutt) + +[Networking](Networking) + +[NvidiaDrivers](NvidiaDrivers) + +[PackageManagement](PackageManagement) + +[pefile](pefile) + +[SSH](SSH) + +[Tmux](Tmux) + +[UoH](UoH) + +[xdg mime](xdg-mime) + + + + + + + diff --git a/vimwiki/Login For Administration.md b/vimwiki/Login For Administration.md new file mode 100644 index 0000000..61f9261 --- /dev/null +++ b/vimwiki/Login For Administration.md @@ -0,0 +1,13 @@ +All cluster admin starts with the main head node, which normal users do not have access to. +To log in directly from outside the cluster ssh to `stri-cluster.herts.ac.uk`. +If already logged in to another cluster machine, you can ssh to `head.data`. + +Once logged in to this machine (which calls itself `‘uhhpc’`) you may use `sudo` to carry out sysadmin tasks. +This has the advantage that it doesn’t leave you sitting at a root prompt. + +Sudo will prompt you for your own password. You do not need to know the root password to use sudo. + +You may of course use this to get a root prompt on another machine by doing e.g. `sudo ssh node001`. +Sudo is not set up on other machines. However, please use sudo if possible on `uhhpc` rather than a root prompt. + + diff --git a/vimwiki/Login.md b/vimwiki/Login.md new file mode 100644 index 0000000..3ae4e13 --- /dev/null +++ b/vimwiki/Login.md @@ -0,0 +1,4 @@ + +[Check User Login](Check User Login) + + diff --git a/vimwiki/Manage Licenses From The License Administrator Tool.md b/vimwiki/Manage Licenses From The License Administrator Tool.md new file mode 100644 index 0000000..d018551 --- /dev/null +++ b/vimwiki/Manage Licenses From The License Administrator Tool.md @@ -0,0 +1,33 @@ +Activating a license transfers the license rights from the Harris Download and Licensing Center +to a node-locked (local) computer or license server. It also creates the features and quantities +of licenses that enable the software to run. When you purchase Harris Geospatial products, you +will receive an email with an activation code to use to activate your software license. The license +is a concurrent process license for each product that was purchased. + +These instructions describe how to activate on a local computer (node-locked licenses). +Licenses are activated over the Internet. + +To open the License Administrator Tool described in this section, use one of the following: + + Linux: From a terminal window, launch the harrislicense command from the `$INSTALL_DIR/idlxx/bin` + directory. Sudo or root permissions are required. + + Mac: From a Finder window, double-click the LicenseAdminstrator.app icon located under + the `$INSTALL_DIR/idlxx` directory. Administrator privileges are required. + +##Activate Licenses## + + 1. In the License Administrator Tool, click `Activate Local License`. + 2. Enter the activation codes. + 3. Enter the Quantity of licenses you are entitled to. + 4. Click Activate. A message appears when the codes are successfully activated. + To view details on the activated licenses for the computer, click View Licenses. + +##To Activate From Command Line## + +Run the following: + `$ activate -a activation-code [-q quantity]` + + + +See [Harris Geospatial Ref:](https://download.flexnetoperations.com/439214/xlsv/937/14099937/idl872-install.html?ftpRequestID=7211280057&server=download.flexnetoperations.com&dtm=DTM20190807154617MzgwNDcxMDMz&authparam=1565217977_36e0337a683f7d3ea8fee050302ebfd9&ext=.html) diff --git a/vimwiki/Media.md b/vimwiki/Media.md new file mode 100644 index 0000000..8447e36 --- /dev/null +++ b/vimwiki/Media.md @@ -0,0 +1,17 @@ +## Media ## + + |--------------|-------------------------------------------| + | App Name | ipk | + |--------------|-------------------------------------------| + | Music | - | + | AccuRadio | com.accuradio.player_1.1.1_all.ipk | + | Drum Machine | de.metaviewsoft.drummachine_1.0.0_all.ipk | + | Beat Box | de.concentrix.beatbox_1.1.0_all.ipk | + | Beeb News | net.palmdoc.beeb_2.3.0_all.ipk | + | My Local Vue | com.mobileteck.mylocalvue_2.0.2.ipk | + | ComicShelf | ca.canuckcoding.comicshelf_1.1.0_all.ipk | + | FilePlayer | com.realmayo.ffplayer_0.6.0_all.ipk | + | SongID | eu.ssglabs.songid_0.1.03_all.ipk | + |--------------|-------------------------------------------| + + diff --git a/vimwiki/Metasploitable.md b/vimwiki/Metasploitable.md new file mode 100644 index 0000000..70a5ea6 --- /dev/null +++ b/vimwiki/Metasploitable.md @@ -0,0 +1,22 @@ +## Metasploitable2 ## + +### Notes ### + +This is Metasploitable2 (Linux) + +Metasploitable is an intentionally vulnerable Linux virtual machine. +This VM can be used to conductecurity training, testecurity tools, and practice common penetration testing techniques. + +The default login and password is **__ msfadmin:msfadmin. __** + +Never expose this VM to an untrusted network (use NAT or Host-only mode if you have any questions what that means). + +To contact the developers, please send email to __ msfdev@metasploit.com __ + + +### Network ### + +** Network Adapter: ** Custom virtual network - vmnet4 + + + diff --git a/vimwiki/MountMacOSXDrive.md b/vimwiki/MountMacOSXDrive.md new file mode 100644 index 0000000..add9025 --- /dev/null +++ b/vimwiki/MountMacOSXDrive.md @@ -0,0 +1,53 @@ +Sometimes you may not be able to mount a HFS partition on linux +and you get the following error: + +`mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error.` + +This is because the the partition is wrapped in a CoreStorage Volume. This can be verfied from the output of fdisk -l. +In the case of this Macbook we get: + +`Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors` +__Disk model: ST2000LX001-1RG1__ +`Units: sectors of 1 * 512 = 512 bytes` +`Sector size (logical/physical): 512 bytes / 4096 bytes` +`I/O size (minimum/optimal): 4096 bytes / 4096 bytes` +`Disklabel type: gpt` +`Disk identifier: 26B36326-E491-4674-9795-D970A4935EAF` +`` +__Device Start End Sectors Size Type__ +`/dev/sda1 40 409639 409600 200M EFI System` +__/dev/sda2 409640 391021447 390611808 186.3G Apple Core storage__ +`/dev/sda3 391021448 392290991 1269544 619.9M Apple boot` +`/dev/sda4 392290992 802347007 410056016 195.5G Apple HFS/HFS+` +`/dev/sda5 802347008 803586047 1239040 605M Linux filesystem` +`/dev/sda6 803586048 979429375 175843328 83.9G Linux filesystem` +`` +` --- ` + +Normally HFS+ uses 2 volume headers each 1024 bytes in from the beginning and end of the volume. With +CoreStorage wrapping however this is no longer the case, so you have to manually specify the HFS volume +size to fix this. To do this use the `testdisk` utility: + +1. `$testdisk /dev/sda ` and select ok for the drive. +2. Select `EFI GPT` for the drive. +3. Press `Analyse` and then `Quick Search`. The output produced will be smaller than the volume given by fdisk + +`TestDisk 7.0, Data Recovery Utility, April 2015` +`Christophe GRENIER <grenier@cgsecurity.org>` +`http://www.cgsecurity.org` +`` +`Disk /dev/sda - 2000 GB / 1863 GiB - CHS 243201 255 63` +` Partition Start End Size in sectors` +`>P EFI System 40 409639 409600 [EFI]` +__ P Mac HFS 409640 390296359 389886720__ +` P Mac HFS 391021448 392290991 1269544` +` P Mac HFS 392290992 802347007 410056016` +`` + +So now multiply the size by the sector size (389886720*512) =199622000640. This is the offset needed. + +4. So can now press q several times to quit the program. +5. The disk can now be mounted as follows: + `$ sudo mount /dev/sda2 -t hfsplus -o ro,sizelimit=199622000640 /mnt` + + diff --git a/vimwiki/Mutt.md b/vimwiki/Mutt.md new file mode 100644 index 0000000..dd9e3ca --- /dev/null +++ b/vimwiki/Mutt.md @@ -0,0 +1,2 @@ + +[Forwarding a message with attachments](Forwarding a message with attachments) diff --git a/vimwiki/Network Manager from CLI.md b/vimwiki/Network Manager from CLI.md new file mode 100644 index 0000000..902cfdf --- /dev/null +++ b/vimwiki/Network Manager from CLI.md @@ -0,0 +1,39 @@ +[Full](Full) article go [here:](https://arstechnica.com/civis/viewtopic.php?t=1163023) + +* To see the status of a connection: + + `# nmcli con status id 'Wired connection 1'` + +* To bring down the interface and disconnect: + + `# nmcli con down id 'Wired connection 1'` + `# nmcli dev disconnect iface eth0` + +* to bring it back up: + + `# nmcli con up id 'Wired connection 1'`` + + +* To get syntax reminders: + + `# nmcli help` + `# nmcli con help` + `# nmcli dev help` + +* Import OpenVPN config from CLI + + `# sudo nmcli connection import type openvpn file OpenVPNFile-config.ovpn` + +* To see a list of wireless APs + + `# sudo nmcli device wifi rescan` + `# sudo nmcli device wifi list` + +* To conncect to wireless AP + + `# sudo nmcli device wifi connect {SSID-Name} password {password}` + +* If Network manager is running but having problems connecting to wireless AP, + stop the nm-watcher service. This script is taken from the nm-examples man + page and checks to make sure that the ethernet connection goes down when a + wifi connection is sought. diff --git a/vimwiki/Networking.md b/vimwiki/Networking.md new file mode 100644 index 0000000..3718a82 --- /dev/null +++ b/vimwiki/Networking.md @@ -0,0 +1,8 @@ + +[Wifi Networking CLI](Wifi Networking CLI) + +[Set up DHCP or static IP Address from CLI](Set up DHCP or static IP Address from CLI) + +[Network Manager from CLI](Network Manager from CLI) + + diff --git a/vimwiki/Nodes.md b/vimwiki/Nodes.md new file mode 100644 index 0000000..4555781 --- /dev/null +++ b/vimwiki/Nodes.md @@ -0,0 +1,24 @@ +__Ganglia__ (https://uhhpc.herts.ac.uk/ganglia/) can be useful to see the state of nodes. + +If a node goes down while a user’s job is running on it, the job will not terminate properly +and may flood the user’s inbox with notifications. If `Ganglia` or `showstate` report a node +is down, consider rebooting it with + +`sudo rebootnode.pl nodexxx` + +This will prompt you for the IDRAC password, which is `rianhs4b`. Once a node has been rebooted, +wait a few minutes, then check that you can ssh into it as a normal user and view your home +directory and /beegfs. If so, bring it back on line with + +`sudo pbsnodes –c nodexxx` + +If a node is misbehaving and you don’t want to/can’t reboot it, you can temporarily remove it +from the pool used the job control system with + +`pbsnodes –o nodexxx` + +– also reversed by + +`pbsnodes –c` + + diff --git a/vimwiki/NvidiaDrivers.md b/vimwiki/NvidiaDrivers.md new file mode 100644 index 0000000..71328ca --- /dev/null +++ b/vimwiki/NvidiaDrivers.md @@ -0,0 +1,44 @@ +***Installation of Nvidia Drivers*** + +1. First need to ensure that the kernel development and header packages are installed. + For Scientific Linux/RHEL/Centos or Fedora type the following yum commands: + `yum groupinstall "Development Tools"` + `yum install kernel-devel kernel-headers dkms` + +2. Before installing the drivers, need the driver product type: + + `lspci -nn | grep VGA` + + which will produce output such as the following: + `01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF108GL [Quadro 600] [10de:0df8] (rev a1)` + + then go to the [NVIDIA](https://www.nvidia.com/Download/index.aspx) official + website and download the appropriate linux driver, + in this case for the Quadro 600 driver. + +3. Disable the Nouveau Driver. This can be done by editing +4. `/etc/modprobe.d/blacklist.conf` and adding the line `blacklist nouveau`. + +5. In addition the following line can be added to the boot options by +6. editing `/etc/default/grub` and adding `nouveau.blacklist` + option to the line: + + `GRUB_CMDLINE_LINUX_DEFAULT="nouveau.blacklist=1"` + + Then run `grub2-mkconfig -o /boot/grub2/grub.cfg` + +7. Create a new initramfs file after taking a backup of the existing one, as follows: + `mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak` + `dracut -v /boot/initramfs-$(uname -r).img $(uname -r)` + `init 3` + `X -configure` + `reboot` + +8. To install the driver make sure that the X-server is stopped (e.g. systemctl stop X ; + or /etc/init.d/gdm stop ; or killall X ; etc.). The can run the Nvidia driver install script: + + `sh NVIDIA-Linux-x86_64-390.10.run` + +9. Then can reboot into Xwindow by typing `init 5` + + diff --git a/vimwiki/PAM Intranet Access and ADFS Certificate Expiry.md b/vimwiki/PAM Intranet Access and ADFS Certificate Expiry.md new file mode 100644 index 0000000..b41a06e --- /dev/null +++ b/vimwiki/PAM Intranet Access and ADFS Certificate Expiry.md @@ -0,0 +1,10 @@ +When the ADFS certificates expire we need to do the following: + +1. download the metadata xml from https://adfs.herts.ac.uk/FederationMetadata/2007-06/FederationMetadata.xml +2. go to https://pam.herts.ac.uk/simplesaml/admin/metadata-converter.php +3. log in (admin, normal server root password) +4. upload metadata xml +5. cut and paste the new metadata info into /var/simplesamlphp/metadata/saml20-idp-remote.php + (we don't seem to use the sp-remote file). + + diff --git a/vimwiki/PackageManagement.md b/vimwiki/PackageManagement.md new file mode 100644 index 0000000..396a261 --- /dev/null +++ b/vimwiki/PackageManagement.md @@ -0,0 +1,12 @@ + + +[Zypper](Zypper) + + +[Pacman](Pacman) + + +[Apt](Apt) + +[Pacman/Apt/Rosetta](Pacman-Apt-Rosetta) + diff --git a/vimwiki/Pacman-Apt-Rosetta.md b/vimwiki/Pacman-Apt-Rosetta.md new file mode 100644 index 0000000..dbefcc8 --- /dev/null +++ b/vimwiki/Pacman-Apt-Rosetta.md @@ -0,0 +1,92 @@ + +[Basic operations](Basic operations) + +[Querying specific packages](Querying specific packages) + +[Querying package lists](Querying package lists) + +Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo +Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par. pacman -Ss dnf search apt search zypper search zypper se [-s] emerge -S; eix +Lists packages which have an update available. Note: Some provide special commands to limit the output to certain installation sources, others use options. pacman -Qu dnf list updates, dnf check-update apt-get upgrade -> n zypper list-updates zypper patch-check (just for patches) emerge -uDNp @world +Display a list of all packages in all installation sources that are handled by the packages management. Some tools provide options or additional commands to limit the output to a specific installation source. pacman -Sl dnf list available apt-cache dumpavail apt-cache dump (Cache only) apt-cache pkgnames zypper packages portageq all_best_visible / +Generates a list of installed packages pacman -Q dnf list installed dpkg --list | grep ^i zypper search --installed-only qlist -IC +List packages that are installed but are not available in any installation source (anymore). pacman -Qm dnf list extras deborphan zypper se -si | grep 'System Packages' eix-test-obsolete +List packages that were recently added to one of the installation sources, i.e. which are new to it. (none) dnf list recent aptitude search '~N' / aptitude forget-new n/a eix-diff +List installed local packages along with version pacman -Q rpm -qa dpkg -l zypper search -s; rpm -qa qlist -ICv +Search locally installed package for names or descriptions pacman -Qs rpm -qa '*<str>*' aptitude search '~i(~n $name|~d $description)' eix -S -I +List packages not required by any other package pacman -Qt dnf leaves deborphan -anp1 emerge -pc +List packages installed explicitly (not as dependencies) pacman -Qe dnf history userinstalled apt-mark showmanual emerge -pvO @selected; eix --selected +List packages installed automatically (as dependencies) pacman -Qd apt-mark showauto +Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo + +[Querying package dependencies](Querying package dependencies) + +Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo +Display packages which require X to be installed, aka show reverse dependencies. pacman -Sii dnf repoquery --alldeps --whatrequires or repoquery --whatr[equires] apt-cache rdepends / aptitude search ~D$pattern zypper search --requires emerge -pvc +Display packages which conflict with given expression (often package). Search can be used as well to mimic this function. dnf repoquery --conflicts aptitude search '~C$pattern' +List all packages which are required for the given package, aka show dependencies. pacman -[S|Q]i dnf repoquery --requires or repoquery -R apt-cache depends / apt-cache show zypper info --requires emerge -ep +List what the current package provides dnf provides dpkg -s / aptitude show zypper info --provides equery files; qlist +List all packages that require a particular package dnf repoquery --alldeps --whatrequires aptitude search ~D{depends,recommends,suggests}:$pattern / aptitude why zypper search --requires equery depends -a +Display all packages that the specified packages obsoletes. dnf list obsoletes apt-cache show +Generates an output suitable for processing with dotty for the given package(s). apt-cache dotty n/a +Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo + +[Installation sources management](Installation sources management) + +Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo +Installation sources management ${EDITOR} /etc/pacman.conf ${EDITOR} /etc/yum.repos.d/${REPO}.repo ${EDITOR} /etc/apt/sources.list ${EDITOR} /etc/zypp/repos.d/${REPO}.repo layman; eselect repository +Add an installation source to the system. Some tools provide additional commands for certain sources, others allow all types of source URI for the add command. Again others, like apt and dnf force editing a sources list. apt-cdrom is a special command, which offers special options design for CDs/DVDs as source. /etc/pacman.conf /etc/yum.repos.d/*.repo apt-cdrom add zypper service-add layman, overlays +Refresh the information about the specified installation source(s) or all installation sources. pacman -Sy (always upgrade the whole system afterwards) dnf clean expire-cache && dnf check-update apt-get update zypper refresh zypper ref emerge --sync;layman -S +Prints a list of all installation sources including important information like URI, alias etc. cat /etc/pacman.d/mirrorlist cat /etc/yum.repos.d/* apt-cache policy zypper service-list layman -l; eselect repository list +List all packages from a certain repo paclist <repo> eix --in-overlay +Disable an installation source for an operation dnf --disablerepo= emerge package::repo-to-use +Download packages from a different version of the distribution than the one installed. dnf --releasever= apt-get install -t release package/ apt-get install package/release (deps not covered) echo "category/package ~amd64" >> /etc/portage/package.keywords && emerge package +Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo + +[Overrides](Overrides) + +Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo +Add a package lock rule to keep its current state from being changed /etc/pacman.conf +modify IgnorePkg array dnf.conf <--”exclude” option (add/amend) apt-mark hold pkg Put package name in /etc/zypp/locks, or zypper al /etc/portage/package.mask +Delete a package lock rule remove package from IgnorePkg line in /etc/pacman.conf apt-mark unhold pkg Remove package name from /etc/zypp/locks or zypper rl /etc/portage/package.mask (or package.unmask) +Show a listing of all lock rules cat /etc/pacman.conf /etc/apt/preferences View /etc/zypp/locks or zypper ll cat /etc/portage/package.mask +Set the priority of the given package to avoid upgrade, force downgrade or to overwrite any default behavior. Can also be used to prefer a package version from a certain installation source. ${EDITOR} /etc/pacman.conf +Modify HoldPkg and/or IgnorePkg arrays /etc/apt/preferences, apt-cache policy zypper mr -p ${EDITOR} /etc/portage/package.accept_keywords +Add a line with =category/package-version +Remove a previously set priority /etc/apt/preferences zypper mr -p ${EDITOR} /etc/portage/package.accept_keywords +remove offending line +Show a list of set priorities. apt-cache policy /etc/apt/preferences zypper lr -p grep -r . /etc/portage/package.accept_keywords +Ignores problems that priorities may trigger. n/a +Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo + +[Verification and repair](Verification and repair) + +Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo +Verify single package pacman -Qk[k] rpm -V debsums rpm -V equery check +Verify all packages pacman -Qk[k] rpm -Va debsums rpm -Va equery check +Reinstall given Package - Will reinstall the given package without dependency hassle. pacman -S dnf reinstall apt install --reinstall zypper install --force emerge -1O +Verify dependencies of the complete system. Used if installation process was forcefully killed. pacman -Dk dnf repoquery --requires apt-get check zypper verify emerge -uDN @world +Use some magic to fix broken dependencies in a system pacman dep level - pacman -Dk, shared lib level - findbrokenpkgs or lddd dnf repoquery --unsatisfied apt-get --fix-broken +aptitude install zypper verify revdep-rebuild +Add a checkpoint to the package system for later rollback (unnecessary, done on every transaction) n/a +Remove a checkpoint from the system N/A N/A n/a +Provide a list of all system checkpoints N/A dnf history list n/a +Rolls entire packages back to a certain date or checkpoint. N/A dnf history rollback n/a +Undo a single specified transaction. N/A dnf history undo n/a +Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo + +[Using package files and building packages](Using package files and building packages) + +Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo +Query a package supplied on the command line rather than an entry in the package management database pacman -Qp rpm -qp dpkg -I +List the contents of a package file pacman -Qpl rpmls rpm -qpl dpkg -c rpm -qpl +Installs local package file, e.g. app.rpm and uses the installation sources to resolve dependencies pacman -U dnf install apt install zypper in emerge +Updates package(s) with local packages and uses the installation sources to resolve dependencies pacman -U dnf upgrade debi emerge +Add a local package to the local package cache mostly for debugging purposes. cp $filename /var/cache/pacman/pkg/ apt-cache add n/a cp $filename /usr/portage/distfiles +Extract a package tar -Jxvf rpm2cpio | cpio -vid dpkg-deb -x rpm2cpio | cpio -vid tar -jxvf +Install/Remove packages to satisfy build-dependencies. Uses information in the source package. Use ABS && makepkg -seoc dnf builddep apt-get build-dep zypper si -d emerge -o +Display the source package to the given package name(s) dnf repoquery -s apt-cache showsrc n/a +Downloads the corresponding source package(s) to the given package name(s) Use ABS && makepkg -o dnf download --source apt-get source / debcheckout zypper source-install emerge --fetchonly +Build a package makepkg -s rpmbuild -ba (normal) +mock (in chroot) debuild rpmbuild -ba; build; osc build ebuild; quickpkg +Check for possible packaging issues namcap rpmlint lintian rpmlint repoman diff --git a/vimwiki/Password Changing.md b/vimwiki/Password Changing.md new file mode 100644 index 0000000..59b60de --- /dev/null +++ b/vimwiki/Password Changing.md @@ -0,0 +1,11 @@ +Users can change their own passwords with the passwd command, but if you need to change a user’s password +without their involvement, do + +`sudo /root/ldifs/star-passwd username` + +which will just prompt for the new password and the LDAP password. + +__Note:__ + +If you need to lock a user out of their account without deleting it, just change the password to +something unguessable. diff --git a/vimwiki/Pre3Install.md b/vimwiki/Pre3Install.md new file mode 100644 index 0000000..3c61a5f --- /dev/null +++ b/vimwiki/Pre3Install.md @@ -0,0 +1,26 @@ + +# List of Programs/Apps to install on Pre3 # + +ipk backup Archive directory is at /home/opensuse/vgg/macosxd1/Computing/Palm/webos/BACKUPS/ipk-backups + +## Home Screens ## + +Here are the Pre3 Homescreens from which you can link to the list of applications they each contain. + + [[Applications]] + [[System]] + [[Internet]] + [[WebOS]] + [[Kids]] + [[Training]] + [[Science]] + [[Media]] + [[Games]] + [[Board Games]] + [[Cards]] + [[3D-RPG]] + [[Catholic]] + [[Just For Fun]] + [[Productivity]] + [[Extras]] + diff --git a/vimwiki/Problems.md b/vimwiki/Problems.md new file mode 100644 index 0000000..b5e6451 --- /dev/null +++ b/vimwiki/Problems.md @@ -0,0 +1,42 @@ + +##1. Problems connecting via ssh.## + +If an attempt at ssh to a host has been denied, (although previously successful), +you may get the following error: + +`ssh_exchange_identification: read: Connection reset by peer` + +This can be caused by an number of reasons. You can first try to delete the line containg the +host from your ~/.ssh/known_host file. If this doesn't work then your ip address may be blocked +and could be listed in the /etc/hosts.deny file. + +To better diagnose the situation try connecting via ssh with the verbose option (-v or -vv) +as this may provide some clues. A message that the connection has been reset by the peer could be +further indication that the ip address is in the host.deny file. +Therefore check the file /etc/hosts.deny for the ip address. If the ip address is listed, +the following steps should then be followed: + + 1. Stop the DenyHosts service: + + `$ systemctl stop denyhosts` + + 2. Remove the ip address from the following files: + + 1. `/etc/hosts.deny` + 2. `/var/lib/denyhosts/hosts` + 3. `/var/lib/denyhosts/hosts-restricted` + 4. `/var/lib/denyhosts/hosts-root` + 5. `/var/lib/denyhosts/hosts-valid` + 6. `/var/lib/denyhosts/users-hosts` + + 3. Start the DenyHosts service: + + `$ systemctl start denyhosts` + + + +###Refs:### + +https://stackoverflow.com/questions/9225300/denyhosts-keeps-adding-back-my-ip + + diff --git a/vimwiki/Procurement.md b/vimwiki/Procurement.md new file mode 100644 index 0000000..8944a21 --- /dev/null +++ b/vimwiki/Procurement.md @@ -0,0 +1,33 @@ + +A few notes about delivery slips and requisition forms from Janis Chevalier. + + +##Delivery Notes:## + +All delivery notes should be scanned in separately and e-mailed to + +`pa-team@herts.ac.uk` & `procurement-cln@herts.ac.uk` + +The paper copies can be either retained or sent in the post to Procurement, MacLaurin Building + +##Requisitions:## + +- Forms to be completed in full detail. +- Information given in the yellow box will not appear on the printed order. +- Only details in the Quotation Ref, Quantity, Description and Price (ex VAT) will. + +- Always attach the quote if the order references one. + +- If you are aware of a Delivery Due date for your order please add in the ‘Comments’ box + +##Delivery Information:## + +Please make sure you enter the room number/location and your name in the _Delivery Instructions_. + +##Budget Codes:## + +Budget codes must be entered in full and with the correct format, examples below: + + `11.100222.3505` _not_ `GL11100222` + `C00123666.01.3636` _not_ `PJC00123663636` + diff --git a/vimwiki/Productivity.md b/vimwiki/Productivity.md new file mode 100644 index 0000000..d3004c8 --- /dev/null +++ b/vimwiki/Productivity.md @@ -0,0 +1,16 @@ +## Productivity ## + + | ------------------------------------------------------------------------------ | + | App Name | ipk | + | ------------------------------------------------------------------------------ | + | PDF View | - | + | QuickOffice | com.quickoffice.webos_2.2.247.ipk | + | Timesheet | com.mystuff.timesheet_0.2.10_all.ipk | + | Sorting Thoughts | com.sortingthoughts.palmpre_1.3.0_all.ipk | + | Google Calender Search | de.vivalv.software.googlecalendarsearch_1.6.2_all.ipk | + | iCallimporter | de.metaviewsoft.icalimporter_2.6.0_all.ipk | + | Expenses | de.smp.expenses_1.0.6_all.ipk | + | Wanderlife Budget | com.wanderlife.app.budget_1.1.0_all.ipk | + | Expensify | com.expensify.expensify_1.0.6_all.ipk | + | ------------------------------------------------------------------------------ | + diff --git a/vimwiki/Python.md b/vimwiki/Python.md new file mode 100644 index 0000000..4043f36 --- /dev/null +++ b/vimwiki/Python.md @@ -0,0 +1,5 @@ + + +[Uninstall via setup.py](Uninstall via setup.py) + +[mps youtube](mps-youtube) diff --git a/vimwiki/Querying specific packages.md b/vimwiki/Querying specific packages.md new file mode 100644 index 0000000..a262bdc --- /dev/null +++ b/vimwiki/Querying specific packages.md @@ -0,0 +1,38 @@ +_QUERYING SPECIFIC PACKAGES_ + + +# Action Arch Debian/Ubuntu + +1. Show all or most information about a package: `pacman -[S|Q]i` `apt show / apt-cache policy` +The tools' verbosity for the default command vary. +But with options, the tools are on par with each +other. + +2. Display local package information: `pacman -Qi` `dpkg -s / aptitude show` + Name, version, description, etc. + +3. Display remote package information: `pacman -Si` `apt-cache show / aptitude show` + Name, version, description, etc. + +4. Display files provided by local package: `pacman -Ql` `dpkg -L` + +5. Display files provided by a remote package: `pacman -Fl` `apt-file list $pattern` + +6. Query the package which provides FILE: `pacman -Qo` `dpkg -S / dlocate` + +7. List the files that the package holds: `pacman -Ql / pacman -Fl` `dpkg-query -L` +Again, this functionality can be mimicked +by other more complex commands. + +8. Displays packages which provide the given `pacman -Fo` `apt-file search` +expression, a.k.a. reverse provides: +Mainly a shortcut to search a specific field. +Other tools might offer this functionality +through the search command. + +9. Search all packages to find the one which holds `pacman -Fs` `apt-file search` +the specified file: +auto-apt is using this functionality. + +10. Show the changelog of a package: `pacman -Qc` `apt-get changelog` + diff --git a/vimwiki/Quickly Quote/.unquote words.md.swp b/vimwiki/Quickly Quote/.unquote words.md.swp Binary files differnew file mode 100644 index 0000000..f14e420 --- /dev/null +++ b/vimwiki/Quickly Quote/.unquote words.md.swp diff --git a/vimwiki/Quickly Quote/unquote words.md b/vimwiki/Quickly Quote/unquote words.md new file mode 100644 index 0000000..6e7a75a --- /dev/null +++ b/vimwiki/Quickly Quote/unquote words.md @@ -0,0 +1,37 @@ + + +###Easy Method### + +Use surround.vim plugin + +###Native Vim methods### + + __Quote a word using single quotes__ + + `ciw'Ctrl+r"'` + + * `ciw` - Delete the word the cursor is on, and end up in insert mode + * `'` - Add the first quote + * `Ctrl+r"` - Insert the contents of the `"` register, aka the last yank/delete. + * `'` - Add the closing quote + + + _Unquote a word that's enclosed in single quotes_ + + `di'hPl2x` + + * `di'` - Delete the word enclosed by single quotes. + * `hP` - Move the cursor left one place (on top of the opening quote) and put the just deleted text before the quote. + * `l` - Move the cursor right one place (on top of the opening quote). + * `2x` - Delete the two quotes. + + _Change single quotes to double quotes_ + + `va':s/\%V'\%V/"/g` + + * `va'` - Visually select the quoted word and the quotes. + * ``:s/`` - Start a replacement. + * ``\%V'\%V` - Only match single quotes that are within the visually selected region. + * ``/"/g` - Replace them all with double quotes. + +See [Stack Overflow Ref:](https://stackoverflow.com/questions/2147875/what-vim-commands-can-be-used-to-quote-unquote-words) diff --git a/vimwiki/Quota Problems.md b/vimwiki/Quota Problems.md new file mode 100644 index 0000000..2094f42 --- /dev/null +++ b/vimwiki/Quota Problems.md @@ -0,0 +1,15 @@ +Users have an enforcing quota on */home* only – 50 GB. +If this fills up they may have problems logging in. + +View a user’s quota with `quota –v –u <username>`. + +On headnode1, you can view all usage with `xfs_quota -x -c report /home` + +If you need to change a quota (and normally you should not do this, +but rather push users towards the use of other storage, such as /beegfs) +then use e.g. + +`xfs_quota –x –c 'limit –u bsoft=60g bhard=61g username' /home` + +Otherwise, encourage users over quota to remove files. + diff --git a/vimwiki/Replacing A Failed Disk in a mdadm RAID.md b/vimwiki/Replacing A Failed Disk in a mdadm RAID.md new file mode 100644 index 0000000..8f80365 --- /dev/null +++ b/vimwiki/Replacing A Failed Disk in a mdadm RAID.md @@ -0,0 +1,63 @@ + +If disk errors are reported there may be H/W problems with the disk. Check dmesg for the following type of errors: + +`[737961.360080] raid5_end_read_request: 64 callbacks suppressed` +`[737961.360087] md/raid:md125: read error corrected (8 sectors at 2722701256 on sdc1)` +`[737961.360093] md/raid:md125: read error corrected (8 sectors at 2722701264 on sdc1)` +`[737961.360095] md/raid:md125: read error corrected (8 sectors at 2722701272 on sdc1)` +`[737961.360098] md/raid:md125: read error corrected (8 sectors at 2722701280 on sdc1)` +`[737961.360100] md/raid:md125: read error corrected (8 sectors at 2722701288 on sdc1)` +`[737961.360102] md/raid:md125: read error corrected (8 sectors at 2722701296 on sdc1)` +`[737961.360105] md/raid:md125: read error corrected (8 sectors at 2722701304 on sdc1)` +`[737961.360107] md/raid:md125: read error corrected (8 sectors at 2722701312 on sdc1)` +`[737961.360109] md/raid:md125: read error corrected (8 sectors at 2722701320 on sdc1)` +`[737961.360112] md/raid:md125: read error corrected (8 sectors at 2722701328 on sdc1)` +`[742462.760119] md: md125: data-check done.` + +Use SMART to investigate the hard drive. + +`$ smartctl -i /dev/sdc` + +The drive can be tested via the following command + +`$ smartctl -t long /dev/sdc` + +The long test will take a while, there is also a short test which can be performed. +The results can be viewed using: + +`$ smartctl -l selftest /dev/sdc` +` ` +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.36.3.el7.x86_64] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF READ SMART DATA SECTION ===` +`SMART Self-test log structure revision number 1` +`Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error` +`# 1 Extended offline Completed: read failure 40% 21930 2722703304` + +Thus this needs to be replaced. To find it can use hdparm to get the serial number. + +`$ hdparm -i /dev/sdc | grep SerialNo` +`Model=ST2000DM001-1ER164, FwRev=CC27, SerialNo=Z4Z5QAY5` + +so before shutting down and replacing the drive mdadm is used to mark the drive as failed and it can +be removed from the raid. + +`$ mdadm --manage /dev/md0 --fail /dev/sdc1` +`$ mdadm --manage /dev/md0 --remove /dev/sdc1` + +Before the old drive is removed the partition table can be dumped using: + +`$ sfdisk -d /dev/sdc > sdc.out` + +Once the new drive has been swapped in, the old partition table can then be used on the new drive: + +`$ sfdisk -d /dev/sdc < sdc.out` + +The new disk is now ready to be included in the raid: + +`$ mdadm --manage /dev/md125 --add /dev/sdc1` + +Finally can monitor the progress of the rebuild using: + +`$ cat /proc/mdstat` diff --git a/vimwiki/SMARTCTL.md b/vimwiki/SMARTCTL.md new file mode 100644 index 0000000..d0ba1a0 --- /dev/null +++ b/vimwiki/SMARTCTL.md @@ -0,0 +1,195 @@ + + +Smartctl (Self-Monitoring, Analysis and Reporting Technology) is a command line +utility where smart disks can be checked for errors and info extracted. + + +##Example:1 Check Whether Smart Capability is enabled or not for the disk## + +`$ smartctl -i /dev/sdb` +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF INFORMATION SECTION ===` +`Model Family: Seagate Momentus 5400.6` +`Device Model: ST9320325AS` +`Serial Number: 5VD2V59T` +`LU WWN Device Id: 5 000c50 020a37ec4` +`Firmware Version: 0002BSM1` +`User Capacity: 320,072,933,376 bytes [320 GB]` +`Sector Size: 512 bytes logical/physical` +`Rotation Rate: 5400 rpm` +`Device is: In smartctl database [for details use: -P show]` +`ATA Version is: ATA8-ACS T13/1699-D revision 4` +`SATA Version is: SATA 2.6, 1.5 Gb/s` +`Local Time is: Sun Nov 16 12:32:09 2014 IST` +`SMART support is: Available - device has SMART capability.` +`SMART support is: Enabled`` + +Where `/dev/sdb` is your hard disk. + +##Example:2 Enable Smart Capability for the disk## + +`$ smartctl -s on /dev/sdb` +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF ENABLE/DISABLE COMMANDS SECTION ===` +`SMART Enabled.` + +##Example:3 Disable Smart Capability for the disk## + +`$ smartctl -s off /dev/sdb` +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF ENABLE/DISABLE COMMANDS SECTION ===` +`SMART Disabled. Use option -s with argument 'on' to enable it.` + +##Example:4 Display Detailed Smart info for the disk## + +`$ smartctl -a /dev/sdb // For IDE drive` +`$ smartctl -a -d ata /dev/sdb // For SATA drive` + +##Example:5 Display Overall health of the Disk## + +`$ smartctl -H /dev/sdb` +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF READ SMART DATA SECTION ===` +`SMART overall-health self-assessment test result: PASSED` +`Warning: This result is based on an Attribute check.` +`Please note the following marginal Attributes:` +`ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE` +`190 Airflow_Temperature_Cel 0x0022 067 045 045 Old_age Always In_the_past 33 (Min/Max 25/33)` +`` +##Example:6 Test Hard drive using long & short option.## + +__Long Test__ + +`$ smartctl --test=long /dev/sdb` +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===` +`Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".` +`Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.` +`Testing has begun.` +`Please wait 102 minutes for test to complete.` +`Test will complete after Sun Nov 16 14:29:43 2014` +`` +`Use smartctl -X to abort test.` + +OR We can redirect test output to a log file , as shown below + +`$ smartctl --test=long /dev/sdb > /var/log/long.text` + +__Short Test__ + +`$ smartctl --test=short /dev/sdb` +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===` +`Sending command: "Execute SMART Short self-test routine immediately in off-line mode".` +`Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.` +`Testing has begun.` +`Please wait 1 minutes for test to complete.` +`Test will complete after Sun Nov 16 12:51:45 2014` +`` +`Use smartctl -X to abort test.` + +OR + +`$ smartctl --test=short /dev/sdb > /var/log/short.text` + +Note : Short test will take maximum 2 minutes whereas in long test there is no time restriction because it read & verify every segment of the entire disk. + +##Example:7 To View Drive’s Self Test result## + +`$ smartctl -l selftest /dev/sdb` +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF READ SMART DATA SECTION ===` +`SMART Self-test log structure revision number 1` +`Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error` +`# 1 Short offline Completed: read failure 90% 492 210841222` +`# 2 Extended offline Completed: read failure 90% 492 210841222` + +##Example:8 Calculate Estimate time to perform test## + +`$ smartctl -c /dev/sdb` +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF READ SMART DATA SECTION ===` +`General SMART Values:` +`Offline data collection status: (0x00) Offline data collection activity` +` was never started.` +` Auto Offline Data Collection: Disabled.` +`Self-test execution status: ( 121) The previous self-test completed having` +` the read element of the test failed.` +`Total time to complete Offline ` +`data collection: ( 0) seconds.` +`Offline data collection` +`capabilities: (0x73) SMART execute Offline immediate.` +` Auto Offline data collection on/off support.` +` Suspend Offline collection upon new` +` command.` +` No Offline surface scan supported.` +` Self-test supported.` +` Conveyance Self-test supported.` +` Selective Self-test supported.` +`SMART capabilities: (0x0003) Saves SMART data before entering` +` power-saving mode.` +` Supports SMART auto save timer.` +`Error logging capability: (0x01) Error logging supported.` +` General Purpose Logging supported.` +`Short self-test routine ` +`recommended polling time: ( 1) minutes.` +`Extended self-test routine` +`recommended polling time: ( 102) minutes.` +`Conveyance self-test routine` +`recommended polling time: ( 2) minutes.` +`SCT capabilities: (0x103b) SCT Status supported.` +` SCT Error Recovery Control supported.` +` SCT Feature Control supported.` +` SCT Data Table supported.` + +##Example:9 Display Error logs of the disk## + +`$ smartctl -l error /dev/sdb` + +Sample Output + +`smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)` +`Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org` +`` +`=== START OF READ SMART DATA SECTION ===` +`SMART Error Log Version: 1` +`ATA Error Count: 5` +` CR = Command Register [HEX]` +` FR = Features Register [HEX]` +` SC = Sector Count Register [HEX]` +` SN = Sector Number Register [HEX]` +` CL = Cylinder Low Register [HEX]` +` CH = Cylinder High Register [HEX]` +` DH = Device/Head Register [HEX]` +` DC = Device Command Register [HEX]` +` ER = Error register [HEX]` +` ST = Status register [HEX]` +`Powered_Up_Time is measured from power on, and printed as` +`DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,` +`SS=sec, and sss=millisec. It "wraps" after 49.710 days.` +`` +`Commands leading to the command that caused the error were:` +` CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name` +` -- -- -- -- -- -- -- -- ---------------- --------------------` +` 25 da 08 e7 e5 a5 4c 00 00:30:44.515 READ DMA EXT` +` 25 da 08 df e5 a5 4c 00 00:30:44.514 READ DMA EXT` +` 25 da 80 5f e5 a5 4c 00 00:30:44.502 READ DMA EXT` +` 25 da f0 5f e6 a5 4c 00 00:30:44.496 READ DMA EXT` +` 25 da 10 4f e6 a5 4c 00 00:30:44.383 READ DMA EXT` + diff --git a/vimwiki/SSH.md b/vimwiki/SSH.md new file mode 100644 index 0000000..2482ec1 --- /dev/null +++ b/vimwiki/SSH.md @@ -0,0 +1,16 @@ +SSH provides a secure channel over an unsecured network in a client-server +architecture, connecting an SSH client application with an SSH server. Common +applications include remote command-line login and remote command execution, +but any network service can be secured with SSH. The protocol specification +distinguishes between two major versions, referred to as SSH-1 and SSH-2. + +[Set up passwordless SSH](Set up passwordless SSH) + +[Examples](Examples) + +[Problems](Problems) + + + + + diff --git a/vimwiki/Science.md b/vimwiki/Science.md new file mode 100644 index 0000000..adf0489 --- /dev/null +++ b/vimwiki/Science.md @@ -0,0 +1,20 @@ +## Science ## + + |----------------------|---------------------------------------------------| + | App Name | ipk | + |----------------------|---------------------------------------------------| + | Physics Encyclopedia | com.scienceapps.physicsencyclopedia_1.0.0_all.ipk | + | SkyORB | com.realtechvr.app.skyorb_1.7.3_all.ipk | + | Moon Info | de.roboter-teile.moon_1.0.6_all.ipk | + | Lunar Pal | com.andytevans.lunarpal_1.2.1_all.ipk | + | Simple PSE Full | de.diplphy.simplpse_1.6.0_all.ipk | + | Eponyms | net.palmdoc.eponyms_2.3.0_all.ipk | + | RPN Scientific | com.spapp.rpnscientific_0.10.21_all.ipk | + | RPN Calculator | com.chrismondok.rpncalc_1.6.6_all.ipk | + | Calculator | de.arkandos.calculator_1.2.2_all.ipk | + | Graphing Calculator | com.willculus.ct8450_1.7.0_all.ipk | + | What's Shaking | com.kliktrayllc.whatsshaking_1.10.2014.ipk | + |----------------------|---------------------------------------------------| + + + diff --git a/vimwiki/Servers.md b/vimwiki/Servers.md new file mode 100644 index 0000000..79f5717 --- /dev/null +++ b/vimwiki/Servers.md @@ -0,0 +1,22 @@ +The cluster depends on a number of servers. + +`uhhpc` -- our administrative login machine. This runs +the job control systems, the system that forwards ssh +connections to headnode1 or headnode2, the web server, +a MariaDB server, and the LDAP server which controls +user accounts. If it goes down the system is probably unusable. + +`headnode1` -- normal user login machine 1, serves /home. +If it goes down the cluster is not usable for normal users. + +`headnode2` -- normal user login machine 2, serves /soft +and runs some licence servers. Software won`t be available if this goes down. + +`stri-server` -- legacy main NFS server. If it goes down +some NFS volumes won`t be available. + +`lofar-server` aka lofar.herts.ac.uk. Login machine for +LOFAR-UK users. Serves /data/lofar. If it goes down LOFAR users will complain. + +`cair-cluster` aka cair-cluster.herts.ac.uk. Login machine and +server for CACP (formerly CAIR) users. If it goes down those users will complain. diff --git a/vimwiki/Set up DHCP or static IP Address from CLI.md b/vimwiki/Set up DHCP or static IP Address from CLI.md new file mode 100644 index 0000000..96a88d8 --- /dev/null +++ b/vimwiki/Set up DHCP or static IP Address from CLI.md @@ -0,0 +1,52 @@ +This guide will show how to setup DHCP or static IP address from command line. +For full details see [the blackmoreops site:](https://www.blackmoreops.com/2015/03/26/setup-dhcp-or-static-ip-address-from-command-line-in-linux/) + +1. STOP and START Networking service + + `# /etc/init.d/networking stop` + + `# /etc/init.d/networking start` + + In systems using systemd, then use the following instead: + `# systemctl stop network.service` + + `# systemctl start network.service` + +2. STOP and START Network-Manager + `# systemctl stop NetworkManager.serviced` + + `# systemctl start NetworkManager.serviced` + +3. Bring up network interface + `# ifconfig eth0 up` + + or + + `ifup eth0` + + At this point the interface doesn't have an IP address + assigned as can be checked by the following command: + + `# ifconfig eth0` + +4. Setting up IP Address via DHCP + `# echo "iface eth0 inet dhcp >> /etc/network/interfaces"` + + and then bring up the interface as in previous step. + +5. Setting up Static IP + `# ifconfig eth0 192.168.43.226` + `# ifconfig eth0 netmask 255.255.255.0` + `# ifconfig eth0 broadcast 192.168.43.255` + ` route add default gw 192.168.43.1 eth0` + +6. Alternative way of setting up Static IP + `# echo -e “iface eth0 inet dhcp\n address 10.1.1.2\n netmask 255.255.255.0\n gateway 10.1.1.1″>>/etc/network/interfaces` + +7. Fix missing Default Gateway + `# ping 8.8.8.8` + +8. Setting up Nameserver/DNS + `# echo “nameserver 8.8.8.8\n nameserver 8.8.4.4″ >>/etc/resolv.conf` + + diff --git a/vimwiki/Set up passwordless SSH.md b/vimwiki/Set up passwordless SSH.md new file mode 100644 index 0000000..d3dc53c --- /dev/null +++ b/vimwiki/Set up passwordless SSH.md @@ -0,0 +1,25 @@ + +##SSH Passwordless Login using Keygen## + +1. _Create authentication ssh-keygen keys on local machine_ + + `$ ssh-keygen -t rsa` + + This creates two key files in your .ssh directory, + one private and one public, id_rsa and id_rsa.pub respectively. + +2. _Create .ssh directory on remote machine_ + + `$ ssh user@remote mkdir -p ~/.ssh` + +3. _Upload the generated public key to remote machine_ + + `$ cat ~/.ssh/id_rsa.pub | ssh user@remote 'cat >> ~/.ssh/authorized_keys'` + +4. _Set permissions on remote machine_ + + `$ ssh user@remote "chmod 700 ~/ssh ; chmod 640 ~/.ssh/authorized_keys"` + +5. _Login to remote machine without password_ + + `ssh user@remote` diff --git a/vimwiki/System.md b/vimwiki/System.md new file mode 100644 index 0000000..38a6459 --- /dev/null +++ b/vimwiki/System.md @@ -0,0 +1,64 @@ +## System ## + + |-----------------------------------------------|--------------------------------------------------------------| + | App Name | ipk | + |-----------------------------------------------|--------------------------------------------------------------| + | Sounds & Ringtones | - | + | Screen & Lock | - | + | Accounts | - | + | Preferences | - | + | Date & Time | - | + | Text Assist | - | + | Location Services | - | + | Regional Settings | - | + | Wifi | - | + | Bluetooth | - | + | FileMgr | ca.canucksoftware.filemgr_2.0.9_all.ipk | + | Clock Sync | de.content754.clocksync_1.3.0_all.ipk | + | File Explorer | de.pcworldsoftware.fileexpl_1.1.1_all.ipk | + | Wifi TP File Browser | com.prenewbie.wifitpbrowser_0.1.5_all.ipk | + | wIRC | org.webosinternals.catalog.wirc_0.4.6_all.ipk | + | ScanCode | de.omoco.scancode_1.0.0_all.ipk | + | PreVPNc | cz.karry.vpnc_0.1.4_all.ipk | + | FreeTether Cleaner | com.mobileteck.freetether.cleaner_1.0.0_all.ipk | + | Archive Manager | de.pcworldsoftware.archivemgr_1.1.2_all.ipk | + | Show Properties | com.palm.org.webosinternals.showprops_0.3.0_all.ipk | + | Certificate Grabber | com.grabber.basiccertgrabber_0.5.8_all.ipk | + | Dr. Battery | de.somline.drbattery_0.1.5_arm.ipk | + | freeTether | org.webosinternals.freetether_1.2.0_arm.ipk | + | OpenSSL Updater | mobi.optware.openssl_0.9.8.12-4_armv7.ipk | + | Lumberjack | org.webosinternals.lumberjack_0.5.0_arm.ipk | + | Internalz Pro | ca.canuckcoding.internalz_1.1.2_all.ipk | + | Export Messages | info.mobo_.exportmessages_1.0.6_all_0.ipk | + | Export Notes | info.mobo_.exportnotes_1.0.0_all.ipk | + | Mode Switcher | com.palm.org.e-lnx.wee.apps.modeswitcher_1.1.1_all.ipk | + | Netstat | org.daemon.de.netstat_1.0.11_all.ipk | + | P2Snippets | com.p2labs.p2snippets_1.0.4_all.ipk | + | Save/Restore | org.webosinternals.saverestore_1.6.0_arm.ipk | + | Tweaks | org.webosinternals.tweaks_3.0.1_all.ipk | + | webOS Quick Actions | eu.medesimo.quickactions_1.1.1_all.ipk | + | Net Speed | com.futurepr0n.netspeedhd_0.0.4_all.ipk | + | Govnah | org.webosinternals.govnah_1.3.9_arm.ipk | + | What Is My IP? | org.netwhiz.whatismyip_0.1.0_all_1.ipk | + | JStop | com.palm.biz.sketchyplace.jstop_0.2.9_all.ipk | + | Impostah | org.webosinternals.impostah_0.9.20_arm.ipk | + | Tailor | org.webosinternals.tailor_0.3.0_all.ipk | + | GAuth | com.gregstoll.gauth_1.1.1_all.ipk | + | Nodoze | com.palm_.app_.com_.pfountz.nodoze_0.6.3_all_0.ipk | + | Wifi File Sharing | com.shiftyaxel.wifisharing_1.4.0_all.ipk | + | Easy Samba | com.shiftyaxel.easysamba_1.1.2_all_0.ipk | + | Homebrew JS service Framework | ca.canucksoftware.js-service-framework_1.0.2_all_1.ipk | + | Optware Advanced Linux Command Line Installer | mobi.optware.ipkg-opt_0.99.163-16_armv7.ipk | + | Optware Bootstrap | org.webosinternals.optware_1.6.1_all.ipk | + | Media Indexer Refresh | de.metaviewsoft.mptagger_0.1.0_all.ipk | + | TouchVol | com.wordpress.touchcontrol.touchvol_0.1.5_all.ipk | + | Audio Switch | com.palm.nl.itura.audioswitch_1.0.0_all.ipk | + | MsgTmpl | info.lebelt.msgtmpl_1.0.1_all.ipk | + | UberKernel (Pre3) | org.webosinternals.kernels.uber-kernel-pre3_2.2.4-38_arm.ipk | + | wTermt | us.ryanhope.wterm_0.4.0-2_arm.ipk | + | Speech Dispatcher | org.webosinternals.speechd_0.7.1-11_armv7.ipk | + | xwTweak | com.xwteam.app.xwtweak_0.2.0_all.ipk | + | WHOIS Mobile | com.ludexmarketing.whois_0.5.2_all.ipk | + | Brightness Unlinked | com.palm_.app_.brightnessunlinked_0.3.3_all.ipk | + |-----------------------------------------------|--------------------------------------------------------------| + diff --git a/vimwiki/TempNotes.md b/vimwiki/TempNotes.md new file mode 100644 index 0000000..5281798 --- /dev/null +++ b/vimwiki/TempNotes.md @@ -0,0 +1,17 @@ +this is a test + +20171118-232249 here are more words +20171118-232421 here are even more words +20171118-232427 cat - +20171118-235323 cat - +20171118-235500 last one +kkkkkkkkk + +20171119-001427 +$(cat -) + + +20171119-005319 cat - + +20171119-010003 + diff --git a/vimwiki/Tmux.md b/vimwiki/Tmux.md new file mode 100644 index 0000000..f65e633 --- /dev/null +++ b/vimwiki/Tmux.md @@ -0,0 +1,21 @@ +# Using shell scripting to setup your tmux environment # + +Can use a simple bootstrap script to setup tmux environment and log into it. +example script + +`#!/bin/sh` +`tmux new-session -d -s hawkhost` + +`tmux new-window -t hawkhost:1 -n 'Server1' 'ssh root@10.x.x.x'` +`tmux new-window -t hawkhost:2 -n 'Server2' 'ssh root@10.x.x.x'` +`tmux new-window -t hawkhost:3 -n 'Server3' 'ssh root@10.x.x.x'` +`tmux new-window -t hawkhost:4 -n 'Server4' 'ssh root@10.x.x.x'` +`tmux new-window -t hawkhost:5 -n 'Server5' 'ssh root@10.x.x.x'` + +`tmux select-window -t hawkhost:1` +`tmux -2 attach-session -t hawkhost` + + +`new-session -d -s hawkhost` creates new session, names it and detaches it. +The new-window commands create 5 new windows and executes the commands. +The last two commands sets the active window and then attaches to the session diff --git a/vimwiki/Training.md b/vimwiki/Training.md new file mode 100644 index 0000000..032c440 --- /dev/null +++ b/vimwiki/Training.md @@ -0,0 +1,16 @@ +## Training/Sports ## + + |-------------------|------------------------------------------------| + | App Name | ipk | + |-------------------|------------------------------------------------| + | ESPN Score Center | com.espn.app.scorecenter_1.0.5_all.ipk | + | Sports Live | com.moresol.live.sports_2.1.8_all.ipk | + | MMA Edition | com.mmaedition_1.0.3_all.ipk | + | IntervalGym | com.lieblsoftware.pregym_1.5.0_all.ipk | + | Titan Stopwatch | com.lieblsoftware.titanstopwatch_1.3.5_all.ipk | + | Recipes Madness | com.mobile.recipesmadness_2.1.0_all.ipk | + | LFPre | com.emsoft.lfpre_1.0.5.ipk | + | Learn to Run | org.ulti.dev.mobile.learn2run_2.2.0_all.ipk | + |-------------------|------------------------------------------------| + + diff --git a/vimwiki/Troubleshooting - Apt.md b/vimwiki/Troubleshooting - Apt.md new file mode 100644 index 0000000..4b3513a --- /dev/null +++ b/vimwiki/Troubleshooting - Apt.md @@ -0,0 +1,9 @@ + +After running +> apt-get update: +> ... +> Reading package lists... Done +> W: Problem unlinking the file q - Clean (21: Is a directory) + + +Now and then something gets corrupted with apt. To fix this delete the directory /var/lib/apt/lists. diff --git a/vimwiki/UPS in Server Room.md b/vimwiki/UPS in Server Room.md new file mode 100644 index 0000000..7e54a43 --- /dev/null +++ b/vimwiki/UPS in Server Room.md @@ -0,0 +1,4 @@ +If an alarm is triggered from the UPS in the server room (beeping), +check the console on the front. If it claims that the battery has +failed a test, reschedule another test and this will cancel the alarm. +The test can be scheduled by going through the menu items on the console. diff --git a/vimwiki/Uninstall via setup.py b/vimwiki/Uninstall via setup.py new file mode 100644 index 0000000..2257200 --- /dev/null +++ b/vimwiki/Uninstall via setup.py @@ -0,0 +1,12 @@ + +To uninstall a python package which has been installed via `python setup.py install` +you have to remove all files manually. If you don't know which files were installed, +you can reinstall the package with the `--record` option to see what was included. +e.g. + +`python setup.py install --record list.txt` + +You can examine the list and then use xargs for the removal: + +`cat list.txt | xargs rm -rf` + diff --git a/vimwiki/Uninstall via setup.py.md b/vimwiki/Uninstall via setup.py.md new file mode 100644 index 0000000..1951c78 --- /dev/null +++ b/vimwiki/Uninstall via setup.py.md @@ -0,0 +1,11 @@ + +To uninstall a python package which has been installed via `python setup.py install` +you have to remove all files manually. If you don't know which files were installed, +you can reinstall the package with the `--record` option to see what was included. +e.g. + +`python setup.py install --record list.txt` + +You can examine the list and then use xargs for the removal: + +`cat list.txt | xargs rm -rf` diff --git a/vimwiki/UoH.md b/vimwiki/UoH.md new file mode 100644 index 0000000..3a08f14 --- /dev/null +++ b/vimwiki/UoH.md @@ -0,0 +1,22 @@ +[UPS in Server Room](UPS in Server Room) + +[Procurement](Procurement) + +[IC and STRI Displays](IC and STRI Displays ) + +[Exchange Email Settings](Email Settings) + +[Libcrypto segfault automount](Libcrypto segfault automount) + +[PAM Intranet Access and ADFS Certificate Expiry](PAM Intranet Access and ADFS Certificate Expiry) + +[Cluster SysAdmin Notes](Cluster SysAdmin Notes) + +[Blocked IP addess](Blocked IP addess) + +[XMA](XMA) + + + + + diff --git a/vimwiki/Usage.md b/vimwiki/Usage.md new file mode 100644 index 0000000..4e5a319 --- /dev/null +++ b/vimwiki/Usage.md @@ -0,0 +1,205 @@ + +# Introduction # + +Simple code snippets to get you started + +## Loading a PE file ## + +Import the module and parse a file. +``` +import pefile +pe = pefile.PE(‘/path/to/pefile.exe’) +``` + +Optionally, setting the _fast\_load_ argument to _True_ will prevent parsing the directories. In large PE files this can make loading significantly faster and it might be a good idea to use it none of the information from the data directories is needed. + +``` +import pefile +pe = pefile.PE(‘/path/to/pefile.exe’, fast_load=True) +``` + +A later call to the _full\_load()_ method would parse the missing information. + + +It's also possible to just parse raw PE data: + +``` +pe = pefile.PE(data=str_object_with_pe_file_data) +``` + + + +## Reading and writing standard header members ## + +Once the PE file is successfully parsed, the data is readily available as attributes of the PE instance. + +``` +pe.OPTIONAL_HEADER.AddressOfEntryPoint +pe.OPTIONAL_HEADER.ImageBase +pe.FILE_HEADER.NumberOfSections +``` + +All of these values support assignment + +``` +pe.OPTIONAL_HEADER.AddressOfEntryPoint = 0xdeadbeef +``` + +and a subsequent call to + +``` +pe.write(filename='file_to_write.exe') +``` + +will write the modified file to disk. + +All the structures and members defined in the PE format should be available with the same names. Some convenient shortcuts exist, for instance the _sections_ list. Usually, all the structures containing a member _Characteristics_ (or similar fields of flags) will contain attributes set to _True_ or _False_ according to the value of the corresponding flag. + +**Notes about the write support** + +_Starting from pefile 1.2 it's possible to write back any changes done to the PE file. One has to be careful with this functionality as it will not be very intelligent reconstructing the PE file. That is, it will not handle displacing structures if that would be needed because a new section/structure has been added._ +_The rule of thumb is, if there's room for an additional header/structure to fit then there'll be no problem and pefile will write it._ +_All other modifications, i.e. changing individual values in header/structure members should work well._ +_One possible useful application of this could be to correct malformed headers used by some malware in order to cause certain analysis tools to malfunction._ + + +## Iterating through the sections ## + +Sections are added to a list accesible as the attribute _sections_ in the PE instance. +The common structure members of the section header are reachable as attributes. + +``` +for section in pe.sections: + print (section.Name, hex(section.VirtualAddress), + hex(section.Misc_VirtualSize), section.SizeOfRawData ) +``` + + +#### Output #### + +``` +('.text', '0x1000L', '0x6D72L', 28160L) +('.data', '0x8000L', '0x1BA8L', 1536L) +('.rsrc', '0xA000L', '0x8948L', 35328L) +``` + + +## Listing the imported symbols ## + +Each directory, if it exists in the PE file being processed, has an entry as _DIRECTORY\_ENTRY\_directoryname_ in the PE instance. The imported symbols can be listed as follows: + +``` +# If the PE file was loaded using the fast_load=True argument, we will need to parse the data directories: +pe.parse_data_directories() + +for entry in pe.DIRECTORY_ENTRY_IMPORT: + print entry.dll + for imp in entry.imports: + print '\t', hex(imp.address), imp.name +``` + + +#### Output #### + +``` +comdlg32.dll + 0x10012A0L PageSetupDlgW + 0x10012A4L FindTextW + 0x10012A8L PrintDlgExW +[snip] +SHELL32.dll + 0x1001154L DragFinish + 0x1001158L DragQueryFileW +``` + + +## Listing the exported symbols ## + +Similarly, the exported symbols can be listed as follows: + +``` +for exp in pe.DIRECTORY_ENTRY_EXPORT.symbols: + print hex(pe.OPTIONAL_HEADER.ImageBase + exp.address), exp.name, exp.ordinal +``` + + +#### Output #### + +``` +0x7ca0ab4f SHUpdateRecycleBinIcon 336 +0x7cab44c0 SHValidateUNC 173 +0x7ca7b0aa SheChangeDirA 337 +0x7ca7b665 SheChangeDirExA 338 +0x7ca7b3e1 SheChangeDirExW 339 +0x7ca7aec6 SheChangeDirW 340 +0x7ca8baae SheConvertPathW 341 +``` + + +## Dumping all the information ## + +``` +print pe.dump_info() +``` + +Will produce a full textial dump of all the parsed information. Check FullDump0x90, [FullDumpTinyPE](FullDumpTinyPE.md) or FullDumpKernel32 for examples. + + +## Retrieving the bytes at the entry point ## + +We can use _pefile_ together with tools like [pydasm](http://dkbza.org/pydasm.html) to build a small disassembler. A toy example might look like the following. + +We first fetch the entry point address, the retrieve 100 bytes starting at the entry point and we loop through the data disassembling as we go: + +``` +ep = pe.OPTIONAL_HEADER.AddressOfEntryPoint +ep_ava = ep+pe.OPTIONAL_HEADER.ImageBase +data = pe.get_memory_mapped_image()[ep:ep+100] +offset = 0 +while offset < len(data): + i = pydasm.get_instruction(data[offset:], pydasm.MODE_32) + print pydasm.get_instruction_string(i, pydasm.FORMAT_INTEL, ep_ava+offset) + offset += i.length +``` + + +#### Output #### + +``` +push byte 0x70 +push dword 0x1001888 +call 0x1006ca8 +xor ebx,ebx +push ebx +mov edi,[0x100114c] +call edi +cmp word [eax],0x5a4d +jnz 0x1006b1d +mov ecx,[eax+0x3c] +add ecx,eax +cmp dword [ecx],0x4550 +jnz 0x1006b1d +movzx eax,[ecx+0x18 +``` + + +## Dumping all the information ## + +Sometimes we might not want to process an entire file if it's very large. Parsing can be time consuming in some cases an we might only be interested in a subset of the information provided by the headers and directories. + +It is possible to indicate _pefile_ to only load a minimal set of the headers (up to the NT Headers) with the **fast\_load** keyword argument and leave the directories unprocessed. The directories can be parsed later on, on demand. + +The following example loads the basic headers and then goes on to parse most of the directories avoiding the relocation information ( the line could have been left out altogether ). + +``` +pe = pefile.PE(os.sys.argv[1], fast_load=True) +pe.parse_data_directories( directories=[ + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_IMPORT'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_EXPORT'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_RESOURCE'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_DEBUG'], +# pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_BASERELOC'], # Do not parse relocations + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_TLS'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT'] ] ) +``` diff --git a/vimwiki/UsageExamples.md b/vimwiki/UsageExamples.md new file mode 100644 index 0000000..98afcd1 --- /dev/null +++ b/vimwiki/UsageExamples.md @@ -0,0 +1,204 @@ +# Introduction # + +Simple code snippets to get you started + +## Loading a PE file ## + +Import the module and parse a file. +``` +import pefile +pe = pefile.PE(‘/path/to/pefile.exe’) +``` + +Optionally, setting the _fast\_load_ argument to _True_ will prevent parsing the directories. In large PE files this can make loading significantly faster and it might be a good idea to use it none of the information from the data directories is needed. + +``` +import pefile +pe = pefile.PE(‘/path/to/pefile.exe’, fast_load=True) +``` + +A later call to the _full\_load()_ method would parse the missing information. + + +It's also possible to just parse raw PE data: + +``` +pe = pefile.PE(data=str_object_with_pe_file_data) +``` + + + +## Reading and writing standard header members ## + +Once the PE file is successfully parsed, the data is readily available as attributes of the PE instance. + +``` +pe.OPTIONAL_HEADER.AddressOfEntryPoint +pe.OPTIONAL_HEADER.ImageBase +pe.FILE_HEADER.NumberOfSections +``` + +All of these values support assignment + +``` +pe.OPTIONAL_HEADER.AddressOfEntryPoint = 0xdeadbeef +``` + +and a subsequent call to + +``` +pe.write(filename='file_to_write.exe') +``` + +will write the modified file to disk. + +All the structures and members defined in the PE format should be available with the same names. Some convenient shortcuts exist, for instance the _sections_ list. Usually, all the structures containing a member _Characteristics_ (or similar fields of flags) will contain attributes set to _True_ or _False_ according to the value of the corresponding flag. + +**Notes about the write support** + +_Starting from pefile 1.2 it's possible to write back any changes done to the PE file. One has to be careful with this functionality as it will not be very intelligent reconstructing the PE file. That is, it will not handle displacing structures if that would be needed because a new section/structure has been added._ +_The rule of thumb is, if there's room for an additional header/structure to fit then there'll be no problem and pefile will write it._ +_All other modifications, i.e. changing individual values in header/structure members should work well._ +_One possible useful application of this could be to correct malformed headers used by some malware in order to cause certain analysis tools to malfunction._ + + +## Iterating through the sections ## + +Sections are added to a list accesible as the attribute _sections_ in the PE instance. +The common structure members of the section header are reachable as attributes. + +``` +for section in pe.sections: + print (section.Name, hex(section.VirtualAddress), + hex(section.Misc_VirtualSize), section.SizeOfRawData ) +``` + + +#### Output #### + +``` +('.text', '0x1000L', '0x6D72L', 28160L) +('.data', '0x8000L', '0x1BA8L', 1536L) +('.rsrc', '0xA000L', '0x8948L', 35328L) +``` + + +## Listing the imported symbols ## + +Each directory, if it exists in the PE file being processed, has an entry as _DIRECTORY\_ENTRY\_directoryname_ in the PE instance. The imported symbols can be listed as follows: + +``` +# If the PE file was loaded using the fast_load=True argument, we will need to parse the data directories: +pe.parse_data_directories() + +for entry in pe.DIRECTORY_ENTRY_IMPORT: + print entry.dll + for imp in entry.imports: + print '\t', hex(imp.address), imp.name +``` + + +#### Output #### + +``` +comdlg32.dll + 0x10012A0L PageSetupDlgW + 0x10012A4L FindTextW + 0x10012A8L PrintDlgExW +[snip] +SHELL32.dll + 0x1001154L DragFinish + 0x1001158L DragQueryFileW +``` + + +## Listing the exported symbols ## + +Similarly, the exported symbols can be listed as follows: + +``` +for exp in pe.DIRECTORY_ENTRY_EXPORT.symbols: + print hex(pe.OPTIONAL_HEADER.ImageBase + exp.address), exp.name, exp.ordinal +``` + + +#### Output #### + +``` +0x7ca0ab4f SHUpdateRecycleBinIcon 336 +0x7cab44c0 SHValidateUNC 173 +0x7ca7b0aa SheChangeDirA 337 +0x7ca7b665 SheChangeDirExA 338 +0x7ca7b3e1 SheChangeDirExW 339 +0x7ca7aec6 SheChangeDirW 340 +0x7ca8baae SheConvertPathW 341 +``` + + +## Dumping all the information ## + +``` +print pe.dump_info() +``` + +Will produce a full textial dump of all the parsed information. Check FullDump0x90, [FullDumpTinyPE](FullDumpTinyPE.md) or FullDumpKernel32 for examples. + + +## Retrieving the bytes at the entry point ## + +We can use _pefile_ together with tools like [pydasm](http://dkbza.org/pydasm.html) to build a small disassembler. A toy example might look like the following. + +We first fetch the entry point address, the retrieve 100 bytes starting at the entry point and we loop through the data disassembling as we go: + +``` +ep = pe.OPTIONAL_HEADER.AddressOfEntryPoint +ep_ava = ep+pe.OPTIONAL_HEADER.ImageBase +data = pe.get_memory_mapped_image()[ep:ep+100] +offset = 0 +while offset < len(data): + i = pydasm.get_instruction(data[offset:], pydasm.MODE_32) + print pydasm.get_instruction_string(i, pydasm.FORMAT_INTEL, ep_ava+offset) + offset += i.length +``` + + +#### Output #### + +``` +push byte 0x70 +push dword 0x1001888 +call 0x1006ca8 +xor ebx,ebx +push ebx +mov edi,[0x100114c] +call edi +cmp word [eax],0x5a4d +jnz 0x1006b1d +mov ecx,[eax+0x3c] +add ecx,eax +cmp dword [ecx],0x4550 +jnz 0x1006b1d +movzx eax,[ecx+0x18 +``` + + +## Dumping all the information ## + +Sometimes we might not want to process an entire file if it's very large. Parsing can be time consuming in some cases an we might only be interested in a subset of the information provided by the headers and directories. + +It is possible to indicate _pefile_ to only load a minimal set of the headers (up to the NT Headers) with the **fast\_load** keyword argument and leave the directories unprocessed. The directories can be parsed later on, on demand. + +The following example loads the basic headers and then goes on to parse most of the directories avoiding the relocation information ( the line could have been left out altogether ). + +``` +pe = pefile.PE(os.sys.argv[1], fast_load=True) +pe.parse_data_directories( directories=[ + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_IMPORT'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_EXPORT'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_RESOURCE'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_DEBUG'], +# pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_BASERELOC'], # Do not parse relocations + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_TLS'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT'], + pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT'] ] ) +```
\ No newline at end of file diff --git a/vimwiki/User Creation .md b/vimwiki/User Creation .md new file mode 100644 index 0000000..9bc39ae --- /dev/null +++ b/vimwiki/User Creation .md @@ -0,0 +1,29 @@ +To create a user on the cluster do `sudo /root/ldifs/addldapuser.py` +This will end by prompting you for the LDAP password, which is the same as the normal root password. + +__When creating a user:__ + + Make sure you have a record of the user’s having accepted the terms of use – this is a GDPR requirement + + Check that you know the username that the user wants. By default this should be the LCS username, + but we allow others; obviously external users have to choose one. Please try to avoid mixed case, + non-alphanumeric characters, or names longer than about 10 characters. + + Check that you know what group the user should be in. + addldapuser.py gives a list of possible groups; we need to get this right to make sure people have + access to restricted resources. Currently useful primary groups for Herts users are: + + `1003` (CAR), + `1004` (CACP, formerly CAIR), 1005 (Computer Science), + `1006` (old Health and Human area, covering Life Sciences), + `1007` (PAM not otherwise covered), + `1008` (Engineering). + + Please never use the default group (`1000`). + + *EITHER* meet the user in person to set the password, + + *OR* set the initial user password to a random, secure string, not a word or the user’s name + (I normally use `XX99xxXX` where `X`, `x` and `9` are different upper case, lower case and numeric characters) + and send the password by a separate e-mail (we don’t want a record of It in the helpdesk system). + diff --git a/vimwiki/User Deletion.md b/vimwiki/User Deletion.md new file mode 100644 index 0000000..3c5f57b --- /dev/null +++ b/vimwiki/User Deletion.md @@ -0,0 +1,5 @@ +Use + +`sudo /root/ldifs/delldapuser username` + + diff --git a/vimwiki/VMWare.md b/vimwiki/VMWare.md new file mode 100644 index 0000000..4f9d9f1 --- /dev/null +++ b/vimwiki/VMWare.md @@ -0,0 +1,13 @@ +# Pentesting Lab Setup # + +## Guest OSes ## + +These are notes for the individual VM's used in the virtual networks for the pen-testing lab. + +[[Kali]] (Kali Linux 2.0) +[[Metasploitable]] (Metasploitable) +[[WindowsXP]] (Windows XP) +[[Windows7]] (Windows 7) +[[Windows-Server]](Windows Server) + + diff --git a/vimwiki/Vim.md b/vimwiki/Vim.md new file mode 100644 index 0000000..c442767 --- /dev/null +++ b/vimwiki/Vim.md @@ -0,0 +1,3 @@ + + +[Quickly Quote/unquote words](Quickly Quote/unquote words) diff --git a/vimwiki/Virtual Machines.md b/vimwiki/Virtual Machines.md new file mode 100644 index 0000000..1d88aa9 --- /dev/null +++ b/vimwiki/Virtual Machines.md @@ -0,0 +1,5 @@ + +[[VMWare]] - Pentest Virtual Network Setup + +[VirtualBox](VirtualBox) + diff --git a/vimwiki/VirtualBox.md b/vimwiki/VirtualBox.md new file mode 100644 index 0000000..4bd9ee0 --- /dev/null +++ b/vimwiki/VirtualBox.md @@ -0,0 +1,52 @@ + +## Remote Login into virtual guest ## + +In order to login remotely into the virtual machine: + + 1. Go into the network settings of the virtual machine. + 2. select a network adaptor and choose NAT + 3. Go into the advanced options and select port forwarding + 4. create a rule to allow ssh as follows: + + 1. Select TCP protocol + 2. Choose a port for the host (3022) + 3. Choose a port for the guest (22) + 4. Give the rule a name (SSH) + + 7. These are automatically created if the vm scripts + (in /home/vgg/bin/VirtualBoxScripts) are used. These + are accessed from the BASH vbx functions which I've created. + + 8. If you are able to log out of the vm guest but can't log in + to it remotely, then make sure that openssh-server has been + installed into the guest vm, and also that it is running. + + Use: + + `sudo systemctl status -l sshd` + + and/or: + + `sudo systemctl start sshd` + + and possibly: + + `sudo systemctl enable sshd` + + 9. You should then be able to log in via: + + `ssh -p 3022 username@127.0.0.1` + + + +## Windows10 ## + +Order Number: 100606546175 + +### Visual Studio Enterprise 2017 32/64-bit (Multilanguage) - Microsoft Imagine - Download + * Product Key: NT399-8Y76G-3DMMX-HXRTC-V8R3F + + +### Windows 10 Education, Version 1709 (Updated November 2017) 32/64-bit (English) - Microsoft Imagine - Download + * Product Key: PNDTF-3BX2F-JRRQ9-M6H7R-QGPJB + diff --git a/vimwiki/WebOS.md b/vimwiki/WebOS.md new file mode 100644 index 0000000..7737bf8 --- /dev/null +++ b/vimwiki/WebOS.md @@ -0,0 +1,10 @@ +## WebOS ## + + |--------------|---------------------------------------------| + | App Name | ipk | + |--------------|---------------------------------------------| + | App Catalog | - | + | WebOSdev2010 | com.domianofblah.webosdev2010_1.0.1_all.ipk | + | Preware | org.webosinternals.preware_1.9.14_arm.ipk | + |--------------|---------------------------------------------| + diff --git a/vimwiki/Wifi Networking CLI.md b/vimwiki/Wifi Networking CLI.md new file mode 100644 index 0000000..b117dad --- /dev/null +++ b/vimwiki/Wifi Networking CLI.md @@ -0,0 +1,71 @@ +[#](#) Connect to wifi network from command line in linux # + +For full article see [the blackmoreops site:](https://www.blackmoreops.com/2014/09/18/connect-to-wifi-network-from-command-line-in-linux/) + +1. Find Available Wifi adapters. + + `# iw dev` + +2. Check Device Status. + + Check to see if the adapter is up/down. + + `# ip link show DEVICE_NAME` + + (where DEVICE_NAME is wlan0, eth0 etc). + Look for the word UP inside the brackets in the first line of output + +3. Bring up the Wifi interface. + + `# ip link set wlan0 up` + + You can check the device status again as in step 2. + +4. Check the connection status. + + `# iw wlan0 link` + +5. Scan to Find the Wifi network. + + `# iw wlan0 scan` + +6. Generate a wpa/wpa2 config file. + + `# wpa_passphrase WIFI-SSID >> /etc/wpa_supplicant.conf` + `# networkpassword` + +7. Connect to wifi network. + + Once there is a configuration file it can be used to connect to the network. + + `# wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf` + + where -B means run in background + -D specifies the the wireless driver (wext is generic wireless driver). + + You can then check connection status as in step 4. + +8. Get an IP using dhclient. + + `# dhclient wlan0` + + IP address can then be vewrified with: + + `ip addr show wlan0` or `ifconfig wlan0` + + Then we check that we have the proper routing rules. + + `ip route show` + + If we need to add routing manually: + + `ip route add default via 10.0.0.138 dev wlan0` + +9. Test connectivity. + + Ping google to check connectivity. + + `# ping 8.8.8.8` + + + diff --git a/vimwiki/Windows-Server.md b/vimwiki/Windows-Server.md new file mode 100644 index 0000000..d8a9240 --- /dev/null +++ b/vimwiki/Windows-Server.md @@ -0,0 +1,5 @@ +## Windows Server 2003 ## + +### Network ### + +** Network Adapter: ** Custom virtual network - vmnet4 diff --git a/vimwiki/Windows7.md b/vimwiki/Windows7.md new file mode 100644 index 0000000..a2b2ee7 --- /dev/null +++ b/vimwiki/Windows7.md @@ -0,0 +1,6 @@ +## Windows 7 ## + +### Network ### + +** Network Adapter: ** Custom virtual network - vmnet3 + Custom virtual network - vmnet4 diff --git a/vimwiki/WindowsXP.md b/vimwiki/WindowsXP.md new file mode 100644 index 0000000..a41af40 --- /dev/null +++ b/vimwiki/WindowsXP.md @@ -0,0 +1,12 @@ +## Windows XP ## + +### Notes ### + +** System: ** Windows XP Home Edition SP1 + +** CD Key: ** VWPC9-HBGPC-TT92X-66QGH-M7JJG + + +### Network ### + +** Network Adapter: ** Custom virtual network - vmnet4 diff --git a/vimwiki/XMA.md b/vimwiki/XMA.md new file mode 100644 index 0000000..ca287cc --- /dev/null +++ b/vimwiki/XMA.md @@ -0,0 +1,8 @@ +##XMA User Account## + +URL: https://he.xma.co.uk/log-in + +Username: v.graffagnino@herts.ac.uk + +Password: asi2iv + diff --git a/vimwiki/conky.md b/vimwiki/conky.md new file mode 100644 index 0000000..eec9407 --- /dev/null +++ b/vimwiki/conky.md @@ -0,0 +1,20 @@ +On new installs sometimes conky script doesnt work correctly with regards to the network info to be displayed. +For instance the current network portion of the conky script is: + + { "full_text" : "${if_up wlan0}${wireless_link_qual_perc wlan0 }% @ ${wireless_essid wlan0} ${addr wlan0}${else} down${endif}" , "color" : ${if_up wlan0} "\#00ff00"${else}"\#ff0000"${endif} }, + + However the wireless_link_qual_perc variable is not displayed. + +This is because conky needs to have root priviledges to access network libraries and functionalities. If you don't want to run conky with root priviledges, +there is a way to give programs the priviledges they need without running them under root priviledges. +In this case , we need to delegate (to Conky's binary file) the appropriate root priviledges to +perform network-related tasks and to capture raw packets from wire/wireless adapter. +Two of these access categories (which conky needs) are cap_net_admin and cap_net_raw. +We need to give conky these classes of permission. This is done by the following command: + + +`sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/conky` + +The conky output is then displayed correctly. + + diff --git a/vimwiki/index.md b/vimwiki/index.md new file mode 100644 index 0000000..0eb6972 --- /dev/null +++ b/vimwiki/index.md @@ -0,0 +1,18 @@ +[[Pre3Install]] - List of apps to install on Pre3 + +[Virtual Machines](Virtual Machines) + +[LinuxAdmin](LinuxAdmin) - Configuration/tips/tweaks/installation requirements etc + +[Python](Python) + +[Vim](Vim) + +[TempNotes](TempNotes) + +[Lectures](Lectures) + +[Jokes](Jokes) + +[API](API) + diff --git a/vimwiki/mps-youtube.md b/vimwiki/mps-youtube.md new file mode 100644 index 0000000..212e053 --- /dev/null +++ b/vimwiki/mps-youtube.md @@ -0,0 +1,30 @@ + +##Core Dump - invalid pointer error## + +If you run mps-youtube and you enter an option from a menu or a query and this causes a core dump with the following error message: + +`*** Error in '$BASEDIR/anaconda3/bin/python': free(): invalid pointer: 0x00007f8fe7372bf8 ***` +`====== Backtrace ======` +`/lib64/libc.so.6(+0x721af)[0x7f8fef3891af]` +`/lib64/libc.so.6(+0x7706)[0x7f8fef38e706]` +`/lib64/libc.so.6(+0x78453)[0x7f8fef38f453]` +`$BASEDIR/anaconda3/bin/../lib/libpython3.6m.so.1.0(PyOS_Readline+0xex)[0x7f8ff024956c]` +`...` +`...` +`...` +`====== Memory map ======` +`...` +`...` +`...` +`6361 abort (core dumped) mpsyt user gotbletu` + +use the linux package manager to install the appropriate readline package. e.g. + +`sudo zypper install libreadline6` + +or + +`yum install readline readline-devel` + + +Make sure also that there is no pip or conda installed readline as this may have caused the problem due to conflict. diff --git a/vimwiki/pefile.md b/vimwiki/pefile.md new file mode 100644 index 0000000..c4cbc8c --- /dev/null +++ b/vimwiki/pefile.md @@ -0,0 +1,2 @@ + +[Usage](Usage) diff --git a/vimwiki/xdg-mime.md b/vimwiki/xdg-mime.md new file mode 100644 index 0000000..973cc52 --- /dev/null +++ b/vimwiki/xdg-mime.md @@ -0,0 +1,57 @@ +## How To Change Default Application From The Command Line ## + +xdg-open basically just looks to see which desktop environment you have and then runs gnome-open, gvfs-open, xfce-open, to open the default application for a particular +filetype. However, xdg-open works perfectly without desktop environment and therefore can be used with the i3 window manager. + +#### Example: Set Transmission as default application to open magnet file. #### + + +* Find out the MIME type string. For file MIME types, you can find it out with file command: + + ` $ file -i Broken_Blossoms.webm ` + + This provides the output as: + + `Broken_Blossoms.webm: video/webm; charset=binary` + + For the above file, MIME type is **video/webm**. + + For URI handlers, the type is x-scheme-handler/<scheme>, where <scheme> is the part of URI before colon, e.g. "http", "mailto" "irc" or "magnet". Following are examples of valid MIME types: + + `x-scheme-handler/http` + `x-scheme-handler/irc` + `x-scheme-handler/magnet` + `x-scheme-handler/mailto` + +* Find out the name of the application .desktop file. + + Installed .desktop files live under **/usr/share/applications**. + + `$ grep "Transmission" -l -r /usr/share/applications` + `/usr/share/applications/transmission-gtk.desktop` + `$` + + In case you have "strange" application that may not have the file at all, you can always create one. Easy way would be to copy an existing one, + rewrite fields you understand and remove those you don't. Refer to the specification for details. + +* Make the assignment using **xdg-mime** command: + + `$ xdg-mime default transmission-gtk.desktop x-scheme-handler/magnet` + + Note that no matter where the file actually is (/usr/share/applications, ~/.local/share/applications...), you always use only the name, not the full path. + +* Normally the command will not output anything. If you want to verify what you just did or see what is currently assigned to any MIME type without opening it: + + `$ xdg-mime query default x-scheme-handler/magnet` + `transmission-gtk.desktop` + `$` + +##### Note 1: ##### + +If you want to check out other MIME types, you can look at /etc/mime.types. It does not contain all types in the world; for example the URI handlers,i +but it could be used for "aggressive" form of handling the associations. For example: + +`grep ^video/ | cut -d\t -f1 | xargs xdg-mime default vlc.desktop` + +would associate all known video formats to VLC. + |
