├── README.md ├── etc ├── dhclient.conf ├── doas.conf ├── fstab ├── hostname.iwn0 ├── printcap ├── rc.conf.local └── wsconsctl.conf ├── home ├── .Xdefaults ├── .config │ ├── hexchat │ │ ├── colors.conf │ │ └── hexchat.conf │ └── i3 │ │ └── config ├── .ddd │ └── init ├── .gdb │ ├── .gitignore │ ├── arch │ │ ├── cm3.init │ │ └── cm3.svd │ ├── auto-load │ │ └── usr │ │ │ └── local │ │ │ └── lib │ │ │ └── libicuuc.so.20.1-gdb.py │ └── py-modules │ │ ├── add-syspath.py │ │ ├── frame.py │ │ └── printers │ │ └── libicuuc.py ├── .gdbinit ├── .gitconfig ├── .i3status.conf ├── .kshrc ├── .mailcap ├── .mbsyncrc ├── .msmtprc ├── .muttrc ├── .profile ├── .urlview ├── .vim │ ├── after │ │ └── ftplugin │ │ │ ├── c.vim │ │ │ ├── sh.vim │ │ │ └── todo.vim │ ├── backup │ │ └── .gitkeep │ ├── compiler │ │ └── clang.vim │ ├── ftdetect │ │ └── todo.vim │ ├── swap │ │ └── .gitkeep │ └── undo │ │ └── .gitkeep ├── .vimrc ├── .weechat │ └── irc.conf ├── .xsession ├── bin │ ├── cool │ ├── dock │ ├── ftdi │ ├── npsubfm │ ├── open-selection-chrome.sh │ ├── open-selection-vim.sh │ ├── reset-audio │ ├── semrm │ ├── subfm │ ├── undock │ ├── upgrade │ ├── vol │ └── warm └── crontab └── packages.txt /README.md: -------------------------------------------------------------------------------- 1 | ## Configuring OpenBSD 2 | 3 | System and user config files for a more pleasant laptop. 4 | 5 | * nicer looking xterm 6 | * mutt+mbsync+msmtp for customized offline imap 7 | * ssh-agent 8 | * using new built-in wifi switching 9 | * lean vimrc for C programming 10 | * properly configured DDD (with egdb inferior) 11 | * usb key in fstab 12 | * docking/undocking scripts 13 | * copy/paste working between xterm and firefox 14 | -------------------------------------------------------------------------------- /etc/dhclient.conf: -------------------------------------------------------------------------------- 1 | send host-name "myhostname"; 2 | supersede domain-name-servers 209.222.18.222, 209.222.18.218; 3 | -------------------------------------------------------------------------------- /etc/doas.conf: -------------------------------------------------------------------------------- 1 | permit persist :wheel 2 | permit nopass myuser as root cmd /sbin/ifconfig 3 | permit nopass myuser as root cmd /sbin/sysctl args machdep.lidaction=0 4 | permit nopass myuser as root cmd /sbin/sysctl args machdep.lidaction=1 5 | permit nopass myuser as root cmd /usr/local/bin/openocd 6 | -------------------------------------------------------------------------------- /etc/fstab: -------------------------------------------------------------------------------- 1 | #add the following line: 2 | /dev/sd3i /mnt/key msdos rw,noexec,noauto 0 0 3 | -------------------------------------------------------------------------------- /etc/hostname.iwn0: -------------------------------------------------------------------------------- 1 | join networkname wpakey foobar 2 | join networkname2 wpakey foobar 3 | dhcp 4 | up 5 | -------------------------------------------------------------------------------- /etc/printcap: -------------------------------------------------------------------------------- 1 | lp|brother:\ 2 | :sh=:\ 3 | :rm=:\ 4 | :sd=/var/spool/output/lpd:\ 5 | :lf=/var/log/lpd-errs:\ 6 | :rp=brother 7 | 8 | -------------------------------------------------------------------------------- /etc/rc.conf.local: -------------------------------------------------------------------------------- 1 | apmd_flags="-A" 2 | sshd_flags=NO 3 | -------------------------------------------------------------------------------- /etc/wsconsctl.conf: -------------------------------------------------------------------------------- 1 | keyboard.encoding=us.swapctrlcaps 2 | keyboard1.encoding=us.swapctrlcaps 3 | -------------------------------------------------------------------------------- /home/.Xdefaults: -------------------------------------------------------------------------------- 1 | XLock.description : off 2 | XLock.echokeys : off 3 | XLock.info : 4 | XLock.background : black 5 | XLock.foreground : white 6 | XLock.mode : blank 7 | XLock.username : user: 8 | XLock.password : pass: 9 | 10 | xterm*loginShell: true 11 | xterm*font: xft:inconsolata:pixelsize=18 12 | XTerm*termName: xterm-256color 13 | XTerm*utf8: 2 14 | ! remove the additional black border 15 | XTerm*borderWidth : 0 16 | XTerm*internalBorder : 2 17 | 18 | XTerm*background: rgb:00/00/00 19 | XTerm*foreground: rgb:ff/ff/ff 20 | XTerm*color0: rgb:00/00/00 21 | XTerm*color1: rgb:d3/62/65 22 | XTerm*color2: rgb:ae/ce/91 23 | XTerm*color3: rgb:e7/e1/8c 24 | XTerm*color4: rgb:7a/7a/b0 25 | XTerm*color5: rgb:96/3c/59 26 | XTerm*color6: rgb:41/81/79 27 | XTerm*color7: rgb:be/be/be 28 | XTerm*color8: rgb:66/66/66 29 | XTerm*color9: rgb:ef/81/71 30 | XTerm*color10: rgb:e5/f7/79 31 | XTerm*color11: rgb:ff/f7/96 32 | XTerm*color12: rgb:41/86/be 33 | XTerm*color13: rgb:ef/9e/be 34 | XTerm*color14: rgb:71/be/be 35 | XTerm*color15: rgb:ff/ff/ff 36 | 37 | XTerm*pointerColor: white 38 | XTerm*pointerColorBackground: black 39 | XTerm*cursorColor: red 40 | XTerm*cursorBlink: false 41 | 42 | XTerm*visualBell: false 43 | Xterm*savelines: 16384 44 | XTerm*ScrollBar: false 45 | XTerm*scrollTtyOutput: false 46 | 47 | xterm*allowMouseOps: true 48 | XTerm*vt100.on2Clicks: word 49 | XTerm*vt100.on3Clicks:regex [^[:space:],()<>'"|]+ 50 | XTerm*vt100.on4Clicks:line 51 | 52 | XTerm.VT100.translations: #override \n\ 53 | Ctrl Shift C: copy-selection(CLIPBOARD) \n\ 54 | Ctrl Shift V: insert-selection(CLIPBOARD) \n\ 55 | Ctrl Shift H: set-altscreen(toggle) 56 | -------------------------------------------------------------------------------- /home/.config/hexchat/colors.conf: -------------------------------------------------------------------------------- 1 | color_0 = ffff ffff ffff 2 | color_1 = 0000 0000 0000 3 | color_2 = 41e9 41e9 bda0 4 | color_3 = 4074 b894 83d7 5 | color_4 = ffff 0000 0000 6 | color_5 = 87ac 3783 425e 7 | color_6 = eb56 0548 fccf 8 | color_7 = fb92 93ff 0424 9 | color_8 = fb72 f70f 0805 10 | color_9 = 03c8 ff6c 9e3d 11 | color_10 = 67ea bd3f bd3f 12 | color_11 = 8181 f4f4 f6f6 13 | color_12 = 52c6 7656 e0ff 14 | color_13 = f73b 04cd cce6 15 | color_14 = 8550 82f1 82f1 16 | color_15 = d2d2 cece cece 17 | color_16 = f74f baae 8a83 18 | color_17 = eb4e 3906 22bd 19 | color_18 = f566 6175 53a1 20 | color_19 = f02a a3d9 4c39 21 | color_20 = fdfd 3333 0101 22 | color_21 = e5e5 a8a8 2d2d 23 | color_22 = d4d4 0000 0000 24 | color_23 = fbfb 9393 0404 25 | color_24 = f684 f684 3932 26 | color_25 = f9f9 6969 0909 27 | color_26 = 264f 7f87 f1c6 28 | color_27 = f6b4 0215 18cd 29 | color_28 = fdfd e064 0101 30 | color_29 = fc7c eddf 0ed7 31 | color_30 = 99cd ad9c f9d8 32 | color_31 = d2d2 cece cece 33 | color_256 = fbfb f8f8 f1f1 34 | color_257 = 0101 6969 c9c9 35 | color_258 = e107 e107 e107 36 | color_259 = 0000 0000 0000 37 | color_260 = 0101 6969 c9c9 38 | color_261 = fbfb 9393 0404 39 | color_262 = f6f6 f6f6 3939 40 | color_263 = f13e 0000 11ea 41 | color_264 = 9595 9595 9595 42 | -------------------------------------------------------------------------------- /home/.config/hexchat/hexchat.conf: -------------------------------------------------------------------------------- 1 | version = 2.12.3 2 | away_auto_unmark = 0 3 | away_omit_alerts = 0 4 | away_reason = I'm busy 5 | away_show_once = 1 6 | away_size_max = 300 7 | away_timeout = 60 8 | away_track = 1 9 | completion_amount = 5 10 | completion_auto = 0 11 | completion_sort = 1 12 | completion_suffix = : 13 | dcc_auto_chat = 0 14 | dcc_auto_recv = 1 15 | dcc_auto_resume = 1 16 | dcc_blocksize = 1024 17 | dcc_completed_dir = 18 | dcc_dir = /tmp 19 | dcc_fast_send = 1 20 | dcc_global_max_get_cps = 0 21 | dcc_global_max_send_cps = 0 22 | dcc_ip = 23 | dcc_ip_from_server = 0 24 | dcc_max_get_cps = 0 25 | dcc_max_send_cps = 0 26 | dcc_permissions = 384 27 | dcc_port_first = 0 28 | dcc_port_last = 0 29 | dcc_remove = 0 30 | dcc_save_nick = 0 31 | dcc_send_fillspaces = 0 32 | dcc_stall_timeout = 60 33 | dcc_timeout = 180 34 | flood_ctcp_num = 5 35 | flood_ctcp_time = 30 36 | flood_msg_num = 5 37 | flood_msg_time = 30 38 | gui_autoopen_chat = 1 39 | gui_autoopen_dialog = 1 40 | gui_autoopen_recv = 1 41 | gui_autoopen_send = 1 42 | gui_chanlist_maxusers = 9999 43 | gui_chanlist_minusers = 5 44 | gui_compact = 0 45 | gui_dialog_height = 256 46 | gui_dialog_left = 0 47 | gui_dialog_top = 0 48 | gui_dialog_width = 500 49 | gui_filesize_iec = 0 50 | gui_focus_omitalerts = 0 51 | gui_hide_menu = 0 52 | gui_input_attr = 1 53 | gui_input_icon = 1 54 | gui_input_nick = 1 55 | gui_input_spell = 1 56 | gui_input_style = 1 57 | gui_join_dialog = 1 58 | gui_lagometer = 1 59 | gui_lang = 15 60 | gui_mode_buttons = 0 61 | gui_pane_divider_position = 714 62 | gui_pane_left_size = 128 63 | gui_pane_right_size = 166 64 | gui_pane_right_size_min = 80 65 | gui_quit_dialog = 0 66 | gui_search_pos = 0 67 | gui_slist_fav = 0 68 | gui_slist_select = 29 69 | gui_slist_skip = 1 70 | gui_tab_chans = 1 71 | gui_tab_dialogs = 1 72 | gui_tab_dots = 0 73 | gui_tab_icons = 1 74 | gui_tab_layout = 2 75 | gui_tab_middleclose = 0 76 | gui_tab_newtofront = 2 77 | gui_tab_pos = 4 78 | gui_tab_scrollchans = 0 79 | gui_tab_server = 1 80 | gui_tab_small = 0 81 | gui_tab_sort = 1 82 | gui_tab_trunc = 20 83 | gui_tab_utils = 0 84 | gui_throttlemeter = 1 85 | gui_topicbar = 1 86 | gui_transparency = 255 87 | gui_tray = 1 88 | gui_tray_away = 0 89 | gui_tray_blink = 1 90 | gui_tray_close = 0 91 | gui_tray_minimize = 0 92 | gui_tray_quiet = 0 93 | gui_ulist_buttons = 0 94 | gui_ulist_color = 0 95 | gui_ulist_count = 1 96 | gui_ulist_doubleclick = QUERY %s 97 | gui_ulist_hide = 0 98 | gui_ulist_icons = 1 99 | gui_ulist_pos = 3 100 | gui_ulist_show_hosts = 0 101 | gui_ulist_sort = 0 102 | gui_ulist_style = 1 103 | gui_url_mod = 0 104 | gui_usermenu = 0 105 | gui_win_height = 1032 106 | gui_win_fullscreen = 0 107 | gui_win_left = 0 108 | gui_win_modes = 1 109 | gui_win_save = 1 110 | gui_win_state = 0 111 | gui_win_swap = 0 112 | gui_win_top = 22 113 | gui_win_ucount = 1 114 | gui_win_width = 1916 115 | identd_server = 0 116 | identd_port = 0 117 | input_balloon_chans = 0 118 | input_balloon_hilight = 0 119 | input_balloon_priv = 0 120 | input_beep_chans = 0 121 | input_beep_hilight = 0 122 | input_beep_priv = 0 123 | input_command_char = / 124 | input_filter_beep = 0 125 | input_flash_chans = 0 126 | input_flash_hilight = 1 127 | input_flash_priv = 1 128 | input_perc_ascii = 0 129 | input_perc_color = 0 130 | input_tray_chans = 0 131 | input_tray_hilight = 1 132 | input_tray_priv = 1 133 | irc_auto_rejoin = 0 134 | irc_ban_type = 1 135 | irc_cap_server_time = 1 136 | irc_conf_mode = 1 137 | irc_extra_hilight = 138 | irc_hide_nickchange = 1 139 | irc_hide_version = 0 140 | irc_hidehost = 0 141 | irc_id_ntext = 142 | irc_id_ytext = 143 | irc_invisible = 0 144 | irc_join_delay = 5 145 | irc_logging = 1 146 | irc_logmask = %n/%c.log 147 | irc_nick1 = foo 148 | irc_nick2 = foo_ 149 | irc_nick3 = foo__ 150 | irc_nick_hilight = 151 | irc_no_hilight = NickServ,ChanServ,InfoServ,N,Q 152 | irc_notice_pos = 0 153 | irc_part_reason = Leaving 154 | irc_quit_reason = Leaving 155 | irc_raw_modes = 0 156 | irc_real_name = realname 157 | irc_servernotice = 0 158 | irc_skip_motd = 0 159 | irc_user_name = foo 160 | irc_wallops = 0 161 | irc_who_join = 1 162 | irc_whois_front = 1 163 | net_auto_reconnect = 1 164 | net_auto_reconnectonfail = 0 165 | net_bind_host = 166 | net_ping_timeout = 60 167 | net_proxy_auth = 0 168 | net_proxy_host = 169 | net_proxy_pass = 170 | net_proxy_port = 0 171 | net_proxy_type = 0 172 | net_proxy_use = 0 173 | net_proxy_user = 174 | net_reconnect_delay = 10 175 | net_throttle = 1 176 | notify_timeout = 15 177 | notify_whois_online = 0 178 | perl_warnings = 0 179 | stamp_log = 1 180 | stamp_log_format = %b %d %H:%M:%S 181 | stamp_text = 1 182 | stamp_text_format = [%H:%M:%S] 183 | text_autocopy_color = 0 184 | text_autocopy_stamp = 0 185 | text_autocopy_text = 1 186 | text_background = 187 | text_color_nicks = 0 188 | text_font = Monospace 13 189 | text_font_main = Monospace 9 190 | text_font_alternative = Arial Unicode MS,Segoe UI Emoji,Lucida Sans Unicode,Meiryo,Symbola,Unifont 191 | text_indent = 1 192 | text_max_indent = 256 193 | text_max_lines = 500 194 | text_replay = 1 195 | text_search_case_match = 0 196 | text_search_highlight_all = 0 197 | text_search_follow = 1 198 | text_search_regexp = 0 199 | text_show_marker = 1 200 | text_show_sep = 1 201 | text_spell_langs = en 202 | text_stripcolor_msg = 0 203 | text_stripcolor_replay = 1 204 | text_stripcolor_topic = 1 205 | text_thin_sep = 1 206 | text_transparent = 0 207 | text_wordwrap = 1 208 | url_grabber = 1 209 | url_grabber_limit = 100 210 | url_logging = 0 211 | -------------------------------------------------------------------------------- /home/.config/i3/config: -------------------------------------------------------------------------------- 1 | set $alt Mod1 2 | 3 | # by default i3 uses vim keys shifted to the left [j-;] 4 | set $up k 5 | set $down j 6 | set $left h 7 | set $right l 8 | 9 | font -*-clean-*-*-*-*-15-*-*-*-*-*-*-* 10 | 11 | bindsym Control+$alt+$left focus left 12 | bindsym Control+$alt+$down focus down 13 | bindsym Control+$alt+$up focus up 14 | bindsym Control+$alt+$right focus right 15 | 16 | bindcode 174 focus left 17 | bindcode 176 focus right 18 | bindcode 160 focus up 19 | 20 | bindsym Control+$alt+Shift+$left move left 21 | bindsym Control+$alt+Shift+$down move down 22 | bindsym Control+$alt+Shift+$up move up 23 | bindsym Control+$alt+Shift+$right move right 24 | 25 | bindsym $alt+Return exec /usr/X11R6/bin/xterm 26 | bindsym $alt+space exec /usr/local/bin/dmenu_run 27 | bindsym $alt+Shift+q kill 28 | bindsym Control+$alt+x exec /usr/X11R6/bin/xlock 29 | 30 | bindsym Control+Shift+o exec "$HOME/bin/open-selection-chrome.sh" 31 | bindsym Control+Shift+e exec "$HOME/bin/open-selection-vim.sh" 32 | 33 | bindsym Control+F5 exec /usr/local/bin/maim ~/scrot/$(date +%s).png 34 | bindsym Control+F6 exec /usr/local/bin/maim -i $(xdotool getactivewindow) ~/scrot/$(date +%s).png 35 | 36 | bindsym $alt+backslash split h 37 | bindsym $alt+minus split v 38 | 39 | bindsym $alt+Shift+Return fullscreen toggle 40 | bindsym $alt+Shift+space floating toggle 41 | 42 | floating_modifier $alt 43 | 44 | bindsym Control+$alt+s layout stacking 45 | bindsym Control+$alt+w layout tabbed 46 | bindsym Control+$alt+e layout toggle split 47 | 48 | # focus the parent container 49 | bindsym Control+$alt+a focus parent 50 | 51 | # Define names for default workspaces for which we configure key bindings later on. 52 | # We use variables to avoid repeating the names in multiple places. 53 | set $ws1 "1" 54 | set $ws2 "2" 55 | set $ws3 "3" 56 | set $ws4 "4" 57 | set $ws5 "5" 58 | set $ws6 "6" 59 | set $ws7 "7" 60 | set $ws8 "8" 61 | set $ws9 "9" 62 | set $ws10 "10" 63 | 64 | # switch to workspace 65 | bindsym $alt+Tab workspace next 66 | bindsym $alt+Shift+Tab workspace prev 67 | 68 | bindsym Control+1 workspace $ws1 69 | bindsym Control+2 workspace $ws2 70 | bindsym Control+3 workspace $ws3 71 | bindsym Control+4 workspace $ws4 72 | bindsym Control+5 workspace $ws5 73 | bindsym Control+6 workspace $ws6 74 | bindsym Control+7 workspace $ws7 75 | bindsym Control+8 workspace $ws8 76 | bindsym Control+9 workspace $ws9 77 | bindsym Control+0 workspace $ws10 78 | 79 | # move focused container to workspace 80 | bindsym Control+Shift+1 move container to workspace $ws1 81 | bindsym Control+Shift+2 move container to workspace $ws2 82 | bindsym Control+Shift+3 move container to workspace $ws3 83 | bindsym Control+Shift+4 move container to workspace $ws4 84 | bindsym Control+Shift+5 move container to workspace $ws5 85 | bindsym Control+Shift+6 move container to workspace $ws6 86 | bindsym Control+Shift+7 move container to workspace $ws7 87 | bindsym Control+Shift+8 move container to workspace $ws8 88 | bindsym Control+Shift+9 move container to workspace $ws9 89 | bindsym Control+Shift+0 move container to workspace $ws10 90 | 91 | # reload the configuration file 92 | bindsym $alt+Shift+c reload 93 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 94 | bindsym $alt+Shift+r restart 95 | # exit i3 (logs you out of your X session) 96 | bindsym $alt+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" 97 | 98 | bindsym $alt+Shift+r mode "resize" 99 | 100 | # resize window (you can also use the mouse for that) 101 | mode "resize" { 102 | bindsym $left resize shrink width 15 px or 15 ppt 103 | bindsym $up resize grow height 15 px or 15 ppt 104 | bindsym $down resize shrink height 15 px or 15 ppt 105 | bindsym $right resize grow width 15 px or 15 ppt 106 | 107 | # back to normal: Enter or Escape or $alt+r 108 | bindsym Return mode "default" 109 | bindsym Escape mode "default" 110 | bindsym $alt+r mode "default" 111 | } 112 | 113 | bar { 114 | status_command i3status 115 | } 116 | -------------------------------------------------------------------------------- /home/.ddd/init: -------------------------------------------------------------------------------- 1 | Ddd*debuggerCommand: /usr/local/bin/egdb 2 | Ddd*rshCommand: ssh -t 3 | Ddd*saveOptionsOnExit: off 4 | 5 | Ddd*XmText.background: black 6 | Ddd*XmText.foreground: white 7 | Ddd*XmTextField.background: black 8 | Ddd*XmTextField.foreground: white 9 | Ddd*XmList.background: black 10 | Ddd*XmList.foreground: white 11 | Ddd*graph_edit.background: #333333 12 | Ddd*graph_edit.edgeColor: red 13 | Ddd*graph_edit.nodeColor: white 14 | Ddd*graph_edit.gridColor: white 15 | 16 | Ddd*renderTable: rt 17 | Ddd*rt*fontType: FONT_IS_XFT 18 | Ddd*rt*fontName: Inconsolata 19 | Ddd*rt*fontSize: 8 20 | 21 | Ddd*gdbSettings: \ 22 | unset extended-prompt\n\ 23 | set prompt (gdb) \n 24 | 25 | ! DO NOT ADD ANYTHING BELOW THIS LINE -- DDD WILL OVERWRITE IT 26 | Ddd*dddinitVersion: 3.3.12 27 | 28 | ! Debugger settings. 29 | Ddd*autoDebugger: off 30 | Ddd*debugger: gdb 31 | Ddd*useSourcePath: off 32 | ! Ddd*bashSettings: 33 | ! Ddd*dbgSettings: 34 | ! Ddd*dbxSettings: 35 | ! Ddd*jdbSettings: 36 | ! Ddd*perlSettings: 37 | ! Ddd*pydbSettings: 38 | ! Ddd*xdbSettings: 39 | 40 | ! Source. 41 | Ddd*findWordsOnly: on 42 | Ddd*findCaseSensitive: on 43 | Ddd*tabWidth: 4 44 | ! Ddd*indentSource: 0 45 | ! Ddd*indentCode: 4 46 | Ddd*cacheSourceFiles: on 47 | Ddd*cacheMachineCode: on 48 | Ddd*displayGlyphs: on 49 | Ddd*displayLineNumbers: off 50 | Ddd*disassemble: off 51 | Ddd*allRegisters: off 52 | 53 | ! Undo Buffer. 54 | ! Ddd*maxUndoDepth: -1 55 | ! Ddd*maxUndoSize: 2000000 56 | 57 | ! Misc preferences. 58 | Ddd*keyboardFocusPolicy: EXPLICIT 59 | Ddd*statusAtBottom: on 60 | Ddd*suppressWarnings: off 61 | Ddd*warnIfLocked: off 62 | Ddd*checkGrabs: on 63 | Ddd*saveHistoryOnExit: on 64 | Ddd*paperSize: 210mm x 297mm 65 | Ddd*blinkWhileBusy: on 66 | Ddd*splashScreen: off 67 | Ddd*startupTips: off 68 | 69 | ! Keys. 70 | Ddd*globalTabCompletion: on 71 | Ddd*cutCopyPasteBindings: Motif 72 | Ddd*selectAllBindings: KDE 73 | 74 | ! Data. 75 | Ddd*pannedGraphEditor: off 76 | 77 | 78 | 79 | 80 | 81 | 82 | Ddd*showBaseDisplayTitles: on 83 | Ddd*showDependentDisplayTitles: off 84 | Ddd*autoCloseDataWindow: on 85 | ! Ddd*graph_edit.GridSize: 16 86 | Ddd*detectAliases: on 87 | Ddd*clusterDisplays: off 88 | Ddd*displayPlacement: XmVERTICAL 89 | Ddd*align2dArrays: on 90 | Ddd*arrayOrientation: XmVERTICAL 91 | Ddd*structOrientation: XmVERTICAL 92 | Ddd*showMemberNames: on 93 | 94 | ! Themes. 95 | Ddd*themes: \ 96 | ! tinyvalues.vsl \n\ 97 | ! suppress.vsl \n\ 98 | ! smallvalues.vsl \n\ 99 | ! smalltitles.vsl \n\ 100 | ! red.vsl \n\ 101 | ! green.vsl \n\ 102 | ! green.vsl\n\ 103 | x86.vsl $eax*;$ebx*;$ecx*;$edx*;($eflags &*\n\ 104 | rednil.vsl *\n 105 | 106 | ! Tips. 107 | Ddd*buttonTips: on 108 | Ddd*valueTips: on 109 | Ddd*buttonDocs: on 110 | Ddd*valueDocs: on 111 | 112 | ! Helpers. 113 | ! Ddd*editCommand: ${XEDITOR-false} +@LINE@ @FILE@ || xterm -e ${EDITOR-vi} +@LINE@ @FILE@ 114 | ! Ddd*getCoreCommand: 115 | ! Ddd*psCommand: ps x 2> /dev/null || ps -ef 2> /dev/null || ps 116 | Ddd*termCommand: xterm -u8 -cr \'red\' -title \'DDD: Execution Window\' -e /bin/sh -c 117 | ! Ddd*uncompressCommand: gzip -d -c 118 | ! Ddd*wwwCommand: firefox -remote \'openURL(@URL@)\' || mozilla -remote \'openURL(@URL@)\' || opera -remote \'openURL(@URL@)\' || ${WWWBROWSER-false} \'@URL@\' || konqueror \'openURL(@URL@)\' || galeon \'openURL(@URL@)\' || skipstone \'openURL(@URL@)\' || light \'openURL(@URL@)\' || netscape -remote \'openURL(@URL@)\' || mozilla \'@URL@\' || kfmbrowser \'@URL@\' || netscape \'@URL@\' || gnudoit \'(w3-fetch \"@URL@\")\' || mosaic \'@URL@\' || Mosaic \'@URL@\' || xterm -e lynx \'@URL@\' 119 | ! Ddd*plotCommand: gnuplot -bg \'grey96\' -font \'@FONT@\' -name \'@NAME@\' -geometry +5000+5000 120 | Ddd*plotTermType: xlib 121 | ! Ddd*printCommand: lpr 122 | 123 | ! Tool Bars. 124 | Ddd*toolbarsAtBottom: on 125 | Ddd*buttonImages: on 126 | Ddd*buttonCaptions: off 127 | Ddd*FlatButtons: on 128 | Ddd*buttonColorKey: g 129 | Ddd*activeButtonColorKey: c 130 | 131 | ! Command Tool. 132 | Ddd*commandToolBar: off 133 | Ddd*toolRightOffset: 7 134 | Ddd*toolTopOffset: 31 135 | 136 | ! Buttons. 137 | Ddd*consoleButtons: 138 | Ddd*sourceButtons: 139 | Ddd*dataButtons: 140 | Ddd*verifyButtons: on 141 | 142 | ! Display shortcuts. 143 | Ddd*bashDisplayShortcuts: 144 | Ddd*dbgDisplayShortcuts: 145 | ! Ddd*dbxDisplayShortcuts: 146 | ! Ddd*gdbDisplayShortcuts: \ 147 | ! /t () // Convert to Bin\n\ 148 | ! /d () // Convert to Dec\n\ 149 | ! /x () // Convert to Hex\n\ 150 | ! /o () // Convert to Oct 151 | Ddd*makeDisplayShortcuts: 152 | ! Ddd*jdbDisplayShortcuts: 153 | ! Ddd*perlDisplayShortcuts: \ 154 | ! sprintf(\"%#x\", ()) // Convert to Hex\n\ 155 | ! sprintf(\"%#o\", ()) // Convert to Oct 156 | ! Ddd*pydbDisplayShortcuts: \ 157 | ! /t () // Convert to Bin\n\ 158 | ! /d () // Convert to Dec\n\ 159 | ! /x () // Convert to Hex\n\ 160 | ! /o () // Convert to Oct 161 | ! Ddd*xdbDisplayShortcuts: 162 | 163 | ! Fonts. 164 | 165 | ! Ddd*defaultFont: helvetica 166 | ! Ddd*variableWidthFont: helvetica 167 | ! Ddd*fixedWidthFont: lucidatypewriter-medium 168 | Ddd*dataFont: helvetica 169 | ! Ddd*defaultFontSize: 120 170 | ! Ddd*variableWidthFontSize: 120 171 | ! Ddd*fixedWidthFontSize: 130 172 | Ddd*dataFontSize: 130 173 | 174 | ! Windows. 175 | Ddd*openDataWindow: off 176 | Ddd*openSourceWindow: on 177 | Ddd*openDebuggerConsole: off 178 | Ddd*Separate: off 179 | Ddd*separateExecWindow: on 180 | Ddd*groupIconify: off 181 | Ddd*uniconifyWhenReady: on 182 | 183 | ! Maintenance. 184 | Ddd*dumpCore: on 185 | Ddd*debugCoreDumps: off 186 | 187 | ! Window sizes. 188 | Ddd*graph_edit.height: 292 189 | Ddd*source_text_w.columns: 73 190 | Ddd*source_text_w.rows: 28 191 | Ddd*code_text_w.columns: 1 192 | Ddd*code_text_w.rows: 1 193 | Ddd*gdb_w.columns: 73 194 | Ddd*gdb_w.rows: 5 195 | -------------------------------------------------------------------------------- /home/.gdb/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /home/.gdb/arch/cm3.init: -------------------------------------------------------------------------------- 1 | directory /usr/local/libopencm3-1.0.0/lib/stm32/f4 2 | tar ext :3333 3 | set remote hardware-breakpoint-limit 6 4 | set remote hardware-watchpoint-limit 4 5 | monitor reset halt 6 | 7 | # https://interrupt.memfault.com/blog/cortex-m-fault-debug 8 | define cm3err 9 | printf "UsageFault Status Register (UFSR)\t" 10 | x/2bt 0xE000ED2A 11 | 12 | printf "BusFault Status Register (BFSR)\t" 13 | x/bt 0xE000ED29 14 | 15 | printf "MemManage Status Register (MMFSR)\t" 16 | x/bt 0xE000ED28 17 | 18 | printf "HardFault Status Register (HFSR)\t" 19 | x/bw 0xE000ED2C 20 | end 21 | -------------------------------------------------------------------------------- /home/.gdb/arch/cm3.svd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 33 | 34 | ARM Ltd. 35 | 36 | ARM 37 | 38 | ARMCM3 39 | 40 | ARMCM 41 | 42 | 1.2 43 | 44 | ARM 32-bit Cortex-M3 Microcontroller based device, CPU clock up to 80MHz, etc. 45 | 46 | 47 | ARM Limited (ARM) is supplying this software for use with Cortex-M\n 48 | processor based microcontroller, but can be equally used for other\n 49 | suitable processor architectures. This file can be freely distributed.\n 50 | Modifications to this file shall be clearly marked.\n 51 | \n 52 | THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED\n 53 | OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\n 54 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.\n 55 | ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR\n 56 | CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. 57 | 58 | 59 | 60 | CM3 61 | r1p1 62 | little 63 | false 64 | false 65 | 4 66 | false 67 | 68 | 8 69 | 70 | 32 71 | 72 | 73 | 32 74 | 76 | read-write 77 | 78 | 0x00000000 79 | 80 | 0xFFFFFFFF 81 | 82 | 83 | 84 | SysTick 85 | 24Bit System Tick Timer for use in RTOS 86 | 0xE000E010 87 | 88 | 0 89 | 0x10 90 | registers 91 | 92 | 93 | 94 | CSR 95 | SysTick Control and Status Register 96 | 0 97 | 32 98 | 0x4 99 | 0xFFFFFFFF 100 | 101 | 102 | ENABLE 103 | Enable SysTick Timer 104 | 0 105 | 1 106 | read-write 107 | 108 | 109 | 0 110 | disabled 111 | 0 112 | 113 | 114 | 1 115 | enabled 116 | 1 117 | 118 | 119 | 120 | 121 | TICKINT 122 | Generate Tick Interrupt 123 | 1 124 | 1 125 | read-write 126 | 127 | 128 | 0 129 | Enable SysTick Exception 130 | 0 131 | 132 | 133 | 1 134 | Disable SysTick Exception 135 | 1 136 | 137 | 138 | 139 | 140 | CLKSOURCE 141 | Source to count from 142 | 2 143 | 1 144 | read-write 145 | 146 | 147 | 0 148 | External Clock 149 | 0 150 | 151 | 152 | 1 153 | CPU Clock 154 | 1 155 | 156 | 157 | 158 | 159 | COUNTFLAG 160 | SysTick counted to zero 161 | 16 162 | 1 163 | read-write 164 | 165 | 166 | 167 | 168 | RVR 169 | SysTick Reload Value Register 170 | 0x4 171 | 0 172 | 0xFFFFFFFF 173 | 174 | 175 | RELOAD 176 | Value to auto reload SysTick after reaching zero 177 | 0 178 | 24 179 | 180 | 181 | 182 | 183 | CVR 184 | SysTick Current Value Register 185 | 0x8 186 | 0 187 | 0xFFFFFFFF 188 | 189 | 190 | CURRENT 191 | Current value 192 | 0 193 | 24 194 | 195 | 196 | 197 | 198 | CALIB 199 | SysTick Calibration Value Register 200 | 0xC 201 | 0 202 | 0xFFFFFFFF 203 | 204 | 205 | TENMS 206 | Reload value to use for 10ms timing 207 | 0 208 | 24 209 | read-only 210 | 211 | 212 | SKEW 213 | Clock Skew 214 | 30 215 | 1 216 | read-only 217 | 218 | 219 | 0 220 | 10ms calibration value is exact 221 | 0 222 | 223 | 224 | 1 225 | 10ms calibration value is inexact, because of the clock frequency 226 | 1 227 | 228 | 229 | 230 | 231 | NOREF 232 | No Ref 233 | 31 234 | 1 235 | read-only 236 | 237 | 238 | 0 239 | Ref Clk available 240 | 0 241 | 242 | 243 | 1 244 | Ref Clk not available 245 | 1 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | WDT 255 | Watchdog Timer 256 | 0x40001000 257 | 258 | 0 259 | 0x10 260 | registers 261 | 262 | 263 | WDT 264 | 1 265 | 266 | 267 | 268 | CSR 269 | Watchdog Control and Status Register 270 | 0 271 | 0x4 272 | 0xFFFFFFFF 273 | 274 | 275 | 276 | 277 | SCB 278 | System Control Block 279 | 0xE000ED00 280 | 281 | 0 282 | 0x40 283 | registers 284 | 285 | 286 | 287 | CPUID 288 | 0x00 289 | read 290 | CPUID Base Register 291 | 292 | 293 | IMPLEMENTER 294 | [31:24] 295 | 296 | 297 | VARIANT 298 | [23:20] 299 | 300 | 301 | PARTNO 302 | [15:4] 303 | 304 | 305 | REVISION 306 | [3:0] 307 | 308 | 309 | 310 | 311 | ICSR 312 | 0x04 313 | Interrupt Control State Register 314 | 315 | 316 | NMIPENDSET 317 | [31:31] 318 | Setting this bit will activate an NMI. Since NMI is higher priority than other exceptions, the NMI exception will activate as soon as it is registered. 319 | 320 | 321 | PENDSVSET 322 | [28:28] 323 | Set a pending PendSV interrupt. This is normally used to request a context switch. Reads back with current state (1 if Pending, 0 if not). 324 | 325 | 326 | PENDSVCLR 327 | [27:27] 328 | Clear a pending PendSV interrupt. 329 | 330 | 331 | PENDSTSET 332 | [26:26] 333 | Set a pending SysTick. Reads back with current state (1 if Pending, 0 if not). 334 | 335 | 336 | PENDSTCLR 337 | [25:25] 338 | Clear a pending SysTick (whether set here or by the timer hardware). 339 | 340 | 341 | ISRPREEMPT 342 | [23:23] 343 | If set, a pending exception will be serviced on exit from the debug halt state. 344 | 345 | 346 | ISRPENDING 347 | [22:22] 348 | Indicates if an external configurable (NVIC generated) interrupt is pending. 349 | 350 | 351 | VECTPENDING 352 | [20:12] 353 | Indicates the exception number for the highest priority pending exception. value == 0: no pending exceptions 354 | 355 | 356 | RETTOBASE 357 | [11:11] 358 | This bit is 1 when the set of all active exceptions minus the IPSR_current_exception yields the empty set. 359 | 360 | 361 | VECTACTIVE 362 | [8:0] 363 | 0:thread mode. >1:the exception number for the current executing exception 364 | 365 | 366 | 367 | 368 | VTOR 369 | 0x08 370 | Vector Table Offset Register 371 | 372 | 373 | TBLBASE 374 | [29:29] 375 | 0:Table base is in CODE, base address 0x00000000. 1:Table base is in RAM, base address 0x20000000 376 | 377 | 378 | TBLOFF 379 | [28:7] 380 | Table offset address[28:7] from the base address defined by TBLBASE. 381 | 382 | 383 | 384 | 385 | AIRCR 386 | 0x0C 387 | Application Interrupt/Reset Control Register 388 | 389 | 390 | VECTKEYSTAT 391 | [31:16] 392 | Key and status 393 | 394 | 395 | ENDIANESS 396 | [15:15] 397 | Big endian 398 | 399 | 400 | PRIGROUP 401 | [10:8] 402 | Causes a signal to be asserted to the outer system that indicates a reset is requested. 403 | 404 | 405 | SYSRESETREQ 406 | [2:2] 407 | Interrupt priority grouping 408 | 409 | 410 | VECTCLRACTIVE 411 | [1:1] 412 | Clear active vector 413 | 414 | 415 | VECTRESET 416 | [0:0] 417 | System Reset 418 | 419 | 420 | 421 | 422 | SCR 423 | 0x10 424 | System Control Register 425 | 426 | 427 | SEVONPEND 428 | [4:4] 429 | WFE to wake up when an interrupt moves from inactive to pended. 430 | 431 | 432 | SLEEPDEEP 433 | [2:2] 434 | Sleep deep 435 | 436 | 437 | SLEEPONEXIT 438 | [1:1] 439 | Sleep on exit when returning from Handler mode to Thread mode. 440 | 441 | 442 | 443 | 444 | CCR 445 | 0x14 446 | Configuration and Control Register 447 | 448 | 449 | STKALIGN 450 | [9:9] 451 | 1: on exception entry, the SP used prior to the exception is adjusted to be 8-byte aligned and the context to restore it is saved.0: only 4-byte alignment is guaranteed for the SP used prior to the exception on exception entry. 452 | 453 | 454 | BFHFNMIGN 455 | [8:8] 456 | When enabled (=1), this causes handlers running at priority -1 and -2 to ignore Precise data access faults. When disabled (=0), these bus faults will cause a lock-up as explained in Unrecoverable exception cases on page B1-43. 457 | 458 | 459 | DIV_0_TRP 460 | [4:4] 461 | Enable bit (=1) for trap on Divide by 0. 462 | 463 | 464 | UNALIGN_TRP 465 | [3:3] 466 | Enable bit (=1) for trapping unaligned half or full word accesses. 467 | 468 | 469 | USERSETMPEND 470 | [1:1] 471 | When this bit is set (=1), the core allows unprivileged (user) code to write the Software Trigger Interrupt register. See Software Trigger Interrupt Register on page B3-23. 472 | 473 | 474 | NONBASETHRDENA 475 | [0:0] 476 | 0 (default): Thread state can only be entered at the Base level of activation (will fault if attempted to another level of activation). 477 | 478 | 479 | 480 | 481 | SHPR1 482 | 0x18 483 | System Handlers 4-7 Priority Register 484 | 485 | 486 | SHPR2 487 | 0x1C 488 | System Handlers 8-11 Priority Register 489 | 490 | 491 | SHPR3 492 | 0x20 493 | System Handlers 12-15 Priority Register 494 | 495 | 496 | SHCSR 497 | 0x24 498 | System Handler Control and State Register 499 | 500 | 501 | USGFAULTENA 502 | [18:18] 503 | Enable for UsageFault. 504 | 505 | 506 | BUSFAULTENA 507 | [17:17] 508 | Enable for BusFault. 509 | 510 | 511 | MEMFAULTENA 512 | [16:16] 513 | Enable for MemManage fault. 514 | 515 | 516 | SVCALLPENDED 517 | [15:15] 518 | Reads as 1 if SVCall is Pending. 519 | 520 | 521 | BUSFAULTPENDED 522 | [14:14] 523 | Reads as 1 if BusFault is Pending. 524 | 525 | 526 | MEMFAULTPENDED 527 | [13:13] 528 | Reads as 1 if MemManage is Pending. 529 | 530 | 531 | USGFAULTPENDED 532 | [12:12] 533 | Reads as 1 if UsageFault is Pending. 534 | 535 | 536 | SYSTICKACT 537 | [11:11] 538 | Reads as 1 if SysTick is Active. 539 | 540 | 541 | PENDSVACT 542 | [10:10] 543 | Reads as 1 if PendSV is Active. 544 | 545 | 546 | MONITORACT 547 | [8:8] 548 | Reads as 1 if the Monitor is Active. 549 | 550 | 551 | SVCALLACT 552 | [7:7] 553 | Reads as 1 if SVCall is Active. 554 | 555 | 556 | USGFAULTACT 557 | [3:3] 558 | Reads as 1 if UsageFault is Active. 559 | 560 | 561 | BUSFAULTACT 562 | [1:1] 563 | Reads as 1 if BusFault is Active. 564 | 565 | 566 | MEMFAULTACT 567 | [0:0] 568 | Reads as 1 if MemManage is Active. 569 | 570 | 571 | 572 | 573 | CFSR 574 | 0x28 575 | Configurable Fault Status Registers 576 | 577 | 578 | BFSR 579 | 0x29 580 | 8 581 | BusFault Status Register 582 | 583 | 584 | BFARVALID 585 | [7:7] 586 | This bit is set if the BFAR register has valid contents. 587 | 588 | 589 | STKERR 590 | [4:4] 591 | This bit indicates a derived bus fault has occurred on exception entry. 592 | 593 | 594 | UNSTKERR 595 | [3:3] 596 | This bit indicates a derived bus fault has occurred on exception return. 597 | 598 | 599 | IMPRECISERR 600 | [2:2] 601 | Imprecise data access error. 602 | 603 | 604 | PRECISERR 605 | [1:1] 606 | Precise data access error. The BFAR is written with the faulting address. 607 | 608 | 609 | IBUSERR 610 | [0:0] 611 | This bit indicates a bus fault on an instruction prefetch. 612 | 613 | 614 | 615 | 616 | UFSR 617 | 0x2A 618 | 16 619 | UsageFault Status Register 620 | 621 | 622 | DIVBYZERO 623 | [9:9] 624 | Divide by zero error. When SDIV or UDIV instruction is used with a divisor of 0, this fault will occur if DIV_0_TRP is enabled. 625 | 626 | 627 | UNALIGNED 628 | [8:8] 629 | Unaligned access error. Multi-word accesses always fault if not word aligned. Unaligned word and halfwords can be configured to fault (UNALIGN_TRP is enabled) 630 | 631 | 632 | NOCP 633 | [3:3] 634 | Coprocessor access error (the coprocessor is disabled or not present) 635 | 636 | 637 | INVPC 638 | [2:2] 639 | Integrity check error on EXC_RETURN. 640 | 641 | 642 | INVSTATE 643 | [1:1] 644 | Invalid EPSR.T bit or illegal EPSR.IT bits for executing instruction 645 | 646 | 647 | UNDEFINSTR 648 | [0:0] 649 | Undefined instruction executed (including those associated with an enabled Coprocessor). 650 | 651 | 652 | 653 | 654 | HFSR 655 | 0x2C 656 | Hard Fault Status Register 657 | 658 | 659 | DEBUGEVT 660 | [31:31] 661 | Debug event, and the Debug Fault Status Register has been updated. Only set when halting debug is disabled (C_DEBUGEN = 0) 662 | 663 | 664 | FORCED 665 | [30:30] 666 | Configurable fault cannot be activated due to priority or because it is disabled. Priority escalated to a HardFault exception. 667 | 668 | 669 | VECTTBL 670 | [1:1] 671 | Fault was due to vector table read on exception processing. 672 | 673 | 674 | 675 | 676 | DFSR 677 | 0x30 678 | Debug Fault Status Register 679 | 680 | 681 | EXTERNAL 682 | [4:4] 683 | An asynchronous exception generated due to the assertion of EDBGRQ. 684 | 685 | 686 | VCATCH 687 | [3:3] 688 | Vector catch triggered. Corresponding FSR will contain the primary cause of the exception. 689 | 690 | 691 | DWTTRAP 692 | [2:2] 693 | Data Watchpoint and Trace trap. Indicates that the core halted due to at least one DWT trap event. 694 | 695 | 696 | BKPT 697 | [1:1] 698 | BKPT instruction executed or breakpoint match in FPB. 699 | 700 | 701 | HALTED 702 | [0:0] 703 | Halt request, including step debug command. Stopped on next instruction. 704 | 705 | 706 | 707 | 708 | MMAR 709 | 0x34 710 | MemManage Address Register 711 | 712 | 713 | BFAR 714 | 0x38 715 | BusFault Address Register 716 | 717 | 718 | AFSR 719 | 0x3C 720 | Auxiliary Fault Status Register 721 | 722 | 723 | 724 | 725 | NVIC 726 | Nested Vectored Interrupt Controller 727 | 0xE000E000 728 | 729 | 0 730 | 0xF04 731 | registers 732 | 733 | 734 | 735 | ISER0 736 | 0x100 737 | Irq 0 to 31 Set Enable Register 738 | 739 | 740 | ISER1 741 | 0x104 742 | Irq 32 to 63 Set Enable Register 743 | 744 | 745 | ICER0 746 | 0x180 747 | Irq 0 to 31 Clear Enable Register 748 | 749 | 750 | ICER1 751 | 0x184 752 | Irq 32 to 63 Clear Enable Register 753 | 754 | 755 | ISPR0 756 | 0x200 757 | Irq 0 to 31 Set Pending Register 758 | 759 | 760 | ISPR1 761 | 0x204 762 | Irq 32 to 63 Set Pending Register 763 | 764 | 765 | ICPR0 766 | 0x280 767 | Irq 0 to 31 Clear Pending Register 768 | 769 | 770 | ICPR1 771 | 0x284 772 | Irq 32 to 63 Clear Pending Register 773 | 774 | 775 | IABR0 776 | 0x300 777 | Irq 0 to 31 Active Status Register 778 | 779 | 780 | IABR1 781 | 0x304 782 | Irq 32 to 63 Active Status Register 783 | 784 | 785 | IPR0 786 | 0x400 787 | Irq 0 to 31 Priority-Level Register 788 | 789 | 790 | IPR1 791 | 0x404 792 | Irq 32 to 63 Priority-Level Register 793 | 794 | 795 | STIR 796 | 0xF00 797 | write 798 | Software Trigger Interrupt Register 799 | 800 | 801 | 802 | 803 | -------------------------------------------------------------------------------- /home/.gdb/auto-load/usr/local/lib/libicuuc.so.20.1-gdb.py: -------------------------------------------------------------------------------- 1 | import gdb.printing 2 | import printers.libicuuc 3 | 4 | gdb.printing.register_pretty_printer( 5 | gdb.current_objfile(), 6 | printers.libicuuc.UCharPrinterInfo()) 7 | -------------------------------------------------------------------------------- /home/.gdb/py-modules/add-syspath.py: -------------------------------------------------------------------------------- 1 | import sys, os 2 | 3 | sys.path.append(os.path.dirname(os.path.realpath(__file__))) 4 | -------------------------------------------------------------------------------- /home/.gdb/py-modules/frame.py: -------------------------------------------------------------------------------- 1 | import gdb 2 | 3 | def frame_indented_name(frame): 4 | # frame.level() is not always available, 5 | # so we traverse the list and count depth 6 | 7 | f = frame 8 | depth = 0 9 | while (f): 10 | depth = depth + 1 11 | f = f.older() 12 | return "%s%s" % (" " * depth, frame.name()) 13 | 14 | def frame_path(f, names=[]): 15 | if (f): 16 | names.insert(0, f.name()) 17 | return frame_path(f.older(), names) 18 | return ",".join(names) 19 | -------------------------------------------------------------------------------- /home/.gdb/py-modules/printers/libicuuc.py: -------------------------------------------------------------------------------- 1 | import gdb.printing, re 2 | 3 | class UCharPrinter: 4 | 'Print ICU UChar string' 5 | 6 | def __init__(self, val): 7 | self.val = val 8 | 9 | # tell gdb to print the value in quotes, like a string 10 | def display_hint(self): 11 | return 'string' 12 | 13 | # the actual work... 14 | def to_string(self): 15 | p_c16 = gdb.lookup_type('char16_t').pointer() 16 | return self.val.cast(p_c16).string('UTF-16') 17 | 18 | # bookkeeping for "info pretty-printer" 19 | class UCharPrinterInfo(gdb.printing.PrettyPrinter): 20 | # friendly name for printer 21 | def __init__(self): 22 | super().__init__('UChar string printer') 23 | self._re = re.compile('^UChar [\[*]') 24 | 25 | # is UCharPrinter appropriate for val? 26 | def __call__(self, val): 27 | if self._re.match(str(val.type)): 28 | return UCharPrinter(val) 29 | -------------------------------------------------------------------------------- /home/.gdbinit: -------------------------------------------------------------------------------- 1 | # don't bother me on quit 2 | set confirm off 3 | 4 | # history 5 | set history filename ~/.gdb/history 6 | set history size 10000 7 | set history save on 8 | 9 | # log a lot 10 | set logging file ~/.gdb/log 11 | set logging overwrite on 12 | set logging on 13 | 14 | # can scroll back in my terminal, and pagination 15 | # is annoyting when setting mass breakpoints 16 | set pagination off 17 | 18 | # user scripting 19 | source /home/myuser/.gdb/py-modules/add-syspath.py 20 | add-auto-load-safe-path /home/myuser/.gdb 21 | add-auto-load-scripts-directory /home/myuser/.gdb/auto-load 22 | 23 | source /home/j/.gdb/py-modules/frame.py 24 | 25 | # trace function calls 26 | 27 | define ftrace 28 | dont-repeat 29 | 30 | set $first_new = 1 + ($bpnum ? $bpnum : 0) 31 | 32 | if $argc < 1 33 | # by default, trace all functions except those that start with 34 | # underscore, since they are weird system things 35 | rbreak ^[a-zA-Z] 36 | else 37 | rbreak $arg0 38 | end 39 | commands 40 | silent 41 | python print(frame_indented_name(gdb.newest_frame())) 42 | cont 43 | end 44 | 45 | printf "\nTracing enabled. To disable, run:\n\tdel %d-%d\n", $first_new, $bpnum 46 | end 47 | 48 | define pstack 49 | dont-repeat 50 | 51 | python print(frame_path(gdb.newest_frame())) 52 | end 53 | 54 | # trace system calls 55 | 56 | define ktrace 57 | dont-repeat 58 | break $arg0 59 | commands 60 | silent 61 | set $pid=getpid() 62 | eval "set $ktraceout=\"/tmp/ktrace.%d.out\"", $pid 63 | printf "ktrace started: %s\n", $ktraceout 64 | eval "shell ktrace -a -f %s -p %d", $ktraceout, $pid 65 | printf "\nrun \"ktrace_stop\" to stop tracing\n\n" 66 | finish 67 | end 68 | end 69 | 70 | define ktrace_stop 71 | set $pid=getpid() 72 | eval "set $ktraceout=\"/tmp/ktrace.%d.out\"", $pid 73 | eval "shell ktrace -c -f %s", $ktraceout 74 | printf "ktrace stopped for %s\n", $ktraceout 75 | end 76 | 77 | define hook-stop 78 | if $display_locals_flag 79 | info locals 80 | end 81 | end 82 | 83 | define display_locals 84 | set $display_locals_flag = 1 85 | end 86 | 87 | define undisplay_locals 88 | set $display_locals_flag = 0 89 | end 90 | -------------------------------------------------------------------------------- /home/.gitconfig: -------------------------------------------------------------------------------- 1 | [include] 2 | path = .sixarm_git_gitconfig/gitconfig 3 | 4 | [user] 5 | name = Joe Nelson 6 | email = joe@begriffs.com 7 | -------------------------------------------------------------------------------- /home/.i3status.conf: -------------------------------------------------------------------------------- 1 | # i3status configuration file. 2 | # see "man i3status" for documentation. 3 | 4 | # It is important that this file is edited as UTF-8. 5 | # The following line should contain a sharp s: 6 | # ß 7 | # If the above line is not correctly displayed, fix your editor first! 8 | 9 | general { 10 | output_format = "i3bar" 11 | colors = true 12 | interval = 5 13 | } 14 | 15 | order += "ipv6" 16 | order += "wireless _first_" 17 | order += "ethernet _first_" 18 | order += "battery all" 19 | order += "disk /" 20 | order += "load" 21 | order += "memory" 22 | order += "tztime local" 23 | order += "cpu_temperature cpu0" 24 | order += "cpu_temperature acpitz0" 25 | order += "volume master" 26 | 27 | cpu_temperature cpu0 { 28 | format = "C: %degrees C" 29 | path = "cpu0" 30 | } 31 | 32 | cpu_temperature acpitz0 { 33 | format = "TZ: %degrees C" 34 | } 35 | 36 | 37 | wireless _first_ { 38 | format_up = "W: (%quality at %essid) %ip" 39 | format_down = "W: down" 40 | } 41 | 42 | ethernet _first_ { 43 | format_up = "E: %ip (%speed)" 44 | format_down = "E: down" 45 | } 46 | 47 | battery all { 48 | format = "%status %percentage %remaining" 49 | } 50 | 51 | disk "/" { 52 | format = "%avail" 53 | } 54 | 55 | volume master { 56 | format = "vol: %volume" 57 | } 58 | 59 | load { 60 | format = "%1min" 61 | } 62 | 63 | memory { 64 | format = "%used | %available" 65 | threshold_degraded = "1G" 66 | format_degraded = "MEMORY < %available" 67 | } 68 | 69 | tztime local { 70 | format = "%Y-%m-%d %l:%M:%S" 71 | } 72 | -------------------------------------------------------------------------------- /home/.kshrc: -------------------------------------------------------------------------------- 1 | set -o noclobber 2 | set -o nounset 3 | set -o vi 4 | 5 | LC_CTYPE=en_US.UTF-8 6 | export LC_CTYPE 7 | 8 | export CC=clang 9 | export EDITOR=/usr/local/bin/vim 10 | export PATH=$HOME/bin:$PATH 11 | export PS1="\W$ " 12 | export SSH_AUTH_SOCK=~/.ssh/ssh-socket 13 | 14 | alias g="git" 15 | alias pman="man -M $HOME/posix-man/issue7" 16 | alias pman6="man -M $HOME/posix-man/issue6" 17 | 18 | alias bt="egdb --batch -ex 'set print addr off' -ex 'set print pretty on' -ex 'set print frame-arguments all' -ex 'thread apply all bt full'" 19 | alias armddd="ddd --gdb --debugger \"arm-none-eabi-gdb -x ~/.gdb/arch/cm3.init\"" 20 | 21 | alias rddd="ddd --debugger gdb --no-exec-window --host" 22 | 23 | alias wifi="doas /sbin/ifconfig iwn0" 24 | 25 | ssh-add -l >/dev/null 2>&1 26 | if [ $? = 2 ]; then 27 | # No ssh-agent running 28 | rm -rf $SSH_AUTH_SOCK 29 | eval `ssh-agent -a $SSH_AUTH_SOCK` 30 | echo $SSH_AGENT_PID >| ~/.ssh/ssh-agent-pid 31 | fi 32 | -------------------------------------------------------------------------------- /home/.mailcap: -------------------------------------------------------------------------------- 1 | text/html; w3m -I %{charset} -T text/html; copiousoutput; 2 | application/zip; unzip -p '%s'; copiousoutput; 3 | text/x-diff; cat %s | colordiff; copiousoutput; 4 | text/x-patch; cat %s | colordiff; copiousoutput; 5 | image/*; sxiv %s; copiousoutput; 6 | -------------------------------------------------------------------------------- /home/.mbsyncrc: -------------------------------------------------------------------------------- 1 | ## ACCOUNTS ######################### 2 | 3 | IMAPAccount fastmail 4 | Host mail.messagingengine.com 5 | Port 992 6 | User foobar 7 | Pass bazbat 8 | # PassCmd "gpg2 --no-tty -q -d ~/.imap-password.gpg" 9 | SSLType IMAPS 10 | SSLVersions TLSv1.2 11 | 12 | ## STORES ########################### 13 | 14 | MaildirStore begriffs_local 15 | Path ~/var/mail/begriffs/ 16 | Inbox ~/var/mail/begriffs/INBOX 17 | MaxSize 0 18 | 19 | IMAPStore begriffs_fastmail 20 | Account fastmail 21 | 22 | ## CHANNELS ######################### 23 | 24 | Channel begriffs 25 | Far :begriffs_fastmail: 26 | Near :begriffs_local: 27 | Patterns * !Trash 28 | MaxSize 0 29 | Create Near 30 | Remove Near 31 | Expunge Near 32 | -------------------------------------------------------------------------------- /home/.msmtprc: -------------------------------------------------------------------------------- 1 | account fastmail 2 | from joe@begriffs.com 3 | host smtp.fastmail.com 4 | port 587 5 | tls on 6 | tls_fingerprint AF:01:8E:7F:FF:36:61:06:C6:F9:D4:38:D1:4E:08:98:78:C8:27:C5:E5:C0:A3:97:49:37:F2:76:90:B1:27:59 7 | 8 | domain fastmail.com 9 | 10 | auth on 11 | user foobar 12 | password bazbat 13 | # passwordeval gpg2 --no-tty -q -d ~/.msmtp-password.gpg 14 | 15 | account default : fastmail 16 | -------------------------------------------------------------------------------- /home/.muttrc: -------------------------------------------------------------------------------- 1 | set from = "joe@begriffs.com" 2 | set realname = "Joe Nelson" 3 | set hostname = "begriffs.com" 4 | 5 | # imap 6 | 7 | set folder = ~/var/mail/begriffs 8 | set mbox_type = maildir 9 | set spoolfile = +INBOX 10 | set postponed = +Drafts 11 | set record = +Sent 12 | 13 | # NOTE: you have to create these cache folders or else the caching won't happen 14 | set header_cache = ~/var/mutt/cache/headers 15 | set tmpdir = ~/var/mutt/temp 16 | 17 | mailboxes +INBOX +friends +util \ 18 | +Sent +Spam +craigslist +local \ 19 | +github +grest +cyberia +tcmaker \ 20 | +bsd-misc +bsd-tech +bsd-bugs +bsd-ann +bsd-ports \ 21 | +radio +icu +bison +i3 +tuhs +gdb \ 22 | +mutt-dev +mutt-users \ 23 | +pg +pg-bugs +pg-docs +pg-www \ 24 | +gnupg-users +libressl +spamit +Archive \ 25 | +DMARC +Drafts +News +Logs 26 | 27 | # smtp 28 | 29 | set sendmail="/usr/local/bin/msmtp" 30 | set use_from=yes 31 | set send_charset="utf-8" 32 | 33 | # index 34 | 35 | set sort = 'threads' 36 | set sort_aux = 'reverse-last-date-received' 37 | set strict_threads = yes 38 | 39 | folder-hook . 'push ' 40 | 41 | set index_format = "%4C %Z %{%b %d} %-15.15L %?M?(#%03M)&(%4l)? %?y?{%.20y}? %s (%c)" 42 | 43 | set sidebar_format = "%B%* %N" 44 | set sidebar_visible = yes 45 | set sidebar_width = 15 46 | set mail_check_stats = yes 47 | 48 | set status_chars = " *%A" 49 | set status_format = "-- [ Folder: %f ]--[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%? (%t tagged)? ]--%>-%?p?( %p postponed )?--" 50 | 51 | set mark_old = no 52 | 53 | # reading 54 | 55 | bind attach view-mailcap 56 | alternative_order text/plain text/html 57 | unauto_view * 58 | auto_view text/html 59 | auto_view text/x-diff 60 | auto_view text/x-patch 61 | 62 | set allow_ansi 63 | 64 | set mailcap_path = ~/.mailcap 65 | set smart_wrap 66 | set pager_index_lines=8 67 | 68 | ignore * 69 | unignore From To Reply-To CC Bcc Subject Date Organization X-Label X-Mailer User-Agent X-Spam-Score 70 | 71 | # writing 72 | 73 | set editor='vim + -c "set ft=mail" -c "set tw=72" -c "set fo=tanq" -c "set wrap" -c "set spell spelllang=en"' 74 | set include=yes 75 | set fast_reply 76 | set copy=yes 77 | set attribution='%n wrote:' 78 | 79 | set edit_headers = yes 80 | 81 | source ~/.mail_aliases 82 | set alias_file=~/.mail_aliases 83 | 84 | # bindings 85 | 86 | bind index,pager \Ck sidebar-prev 87 | bind index,pager \Cj sidebar-next 88 | bind index,pager \Cl sidebar-open 89 | bind index,pager \Cf sidebar-toggle-visible 90 | 91 | macro pager \Cu "set pipe_decode = yesurlviewset pipe_decode = no" "view URLs" 92 | 93 | bind index l display-message 94 | bind index gg first-entry 95 | bind index G last-entry 96 | bind index h noop 97 | bind index za collapse-thread 98 | 99 | macro index gR "mbsync -a" "sync inbox" 100 | macro index A \ 101 | "~NN.~OO." \ 102 | "mark all new as read" 103 | 104 | bind pager h exit 105 | bind pager gg top 106 | bind pager G bottom 107 | bind pager J next-line 108 | bind pager K previous-line 109 | bind pager next-line 110 | bind pager previous-line 111 | 112 | bind browser l select-entry 113 | bind browser L view-file 114 | bind browser gg first-entry 115 | bind browser G last-entry 116 | bind browser h exit 117 | 118 | bind attach h exit 119 | bind attach e edit-type 120 | bind attach l view-attach 121 | 122 | bind index \t next-unread 123 | bind pager \t next-unread 124 | 125 | bind pager,index dd delete-message 126 | bind pager,index dT delete-thread 127 | bind pager,index dt delete-subthread 128 | bind index { previous-thread 129 | bind pager { half-up 130 | bind index } next-thread 131 | bind pager } half-down 132 | bind index - collapse-thread 133 | bind index _ collapse-all 134 | 135 | bind pager,index R group-reply 136 | 137 | ## Color 138 | ## ripped off from https://github.com/rgil-shub/config/blob/master/.mutt/colors 139 | 140 | # basic colors 141 | color normal white default 142 | color error brightred default 143 | color tilde magenta default 144 | color message white default 145 | color markers red white 146 | color attachment brightcyan default 147 | color search brightwhite green 148 | color status brightyellow default 149 | # set arrow_cursor 150 | color indicator brightyellow color236 151 | color tree yellow default 152 | # index 153 | color index blue default "~P" # messages from me 154 | color index brightblue default "~v" # threads 155 | color index magenta default "~F" # flagged messages 156 | color index green default "~T" # tagged messages 157 | color index red default "~=" # duplicated messages 158 | color index brightwhite default "~O" # new messages 159 | color index brightwhite default "~N" # new messages 160 | color index brightred default "~D" # deleted messages 161 | # compose 162 | color compose header brightwhite default 163 | color compose security_none red default 164 | color compose security_encrypt brightgreen default 165 | color compose security_sign brightgreen default 166 | color compose security_both brightgreen default 167 | # headers 168 | color hdrdefault white default 169 | color header brightblue default ^Subject: 170 | color header white default ^From: 171 | color header magenta default ^User-Agent: 172 | color header magenta default ^X-Mailer: 173 | color header magenta default ^X-Operating-System: 174 | color header magenta default ^X-PGP-Key: 175 | color header brightred default "^(X-Priority: 1)" # message priority 176 | color header brightred default "^(Importance: high)" # message priority 177 | color header brightgreen default "^(X-Tls-Protocol: TLSv1.3)" # sieve rule 178 | color header magenta default "^(X-Tls-Protocol: TLSv1.2)" # sieve rule 179 | color header brightred default "^(X-Tls-Protocol: TLSv1.1)" # sieve rule 180 | color header brightred default "^(X-Tls-Protocol: TLSv1.0)" # sieve rule 181 | color header brightred default "^(X-Tls-Protocol: NONE)" # sieve rule 182 | color header magenta default "^(X-Tls-Cipher)" # sieve rule 183 | color header brightred default "^(X-Tls-Cipher: NONE)" # sieve rule 184 | # body 185 | color quoted blue default 186 | color quoted1 cyan default 187 | color quoted2 yellow default 188 | color signature magenta default 189 | color bold brightmagenta default 190 | color underline brightgreen default 191 | color body magenta default "(ftp|http|https)://[^ ]+" # point out URLs 192 | color body magenta default [-a-z_0-9.]+@[-a-z_0-9.]+ # e-mail addresses 193 | color body brightcyan default "[;:][-o][)/(|]" # emoticons 194 | color body brightcyan default "[;:][)(|]" # emoticons 195 | color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? 196 | color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? 197 | color body brightcyan default "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\ 198 | |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\ 199 | |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?" 200 | # pgp 201 | color body yellow default "^gpg: .*" 202 | color body yellow default "^Hash: .*" 203 | color body brightred default "^gpg: Firma INCORRECTA.*" 204 | color body brightred default "^gpg: BAD signature.*" 205 | color body brightred default "^Bad signature from:*" 206 | color body green default "^gpg: Firma correcta.*" 207 | color body green default "^gpg: Good signature .*" 208 | color body green default "^Good signature from:*" 209 | color body brightcyan default "-----BEGIN PGP SIGNED MESSAGE-----" 210 | color body brightcyan default "-----BEGIN PGP SIGNATURE-----" 211 | color body brightcyan default "-----END PGP SIGNATURE-----" 212 | 213 | # Patch syntax highlighting 214 | color body brightwhite default ^(diff).* 215 | color body green default ^[\+][^\+].* 216 | color body red default ^[\-][^\-].* 217 | color body brightblue default ^@@.* 218 | color body brightwhite default ^(Signed-off-by).* 219 | color body brightwhite default ^(Cc) 220 | 221 | # external tools 222 | 223 | unset wait_key 224 | 225 | # PGP 226 | 227 | source /usr/local/share/examples/mutt/gpg.rc 228 | 229 | # shell out to gpg programs rather than using gpgme library 230 | unset crypt_use_gpgme 231 | 232 | set pgp_default_key="0xdeadbeef" 233 | set pgp_sign_as="0xc0ffee" 234 | -------------------------------------------------------------------------------- /home/.profile: -------------------------------------------------------------------------------- 1 | # $OpenBSD: dot.profile,v 1.4 2005/02/16 06:56:57 matthieu Exp $ 2 | # 3 | # sh/ksh initialization 4 | 5 | PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:. 6 | export PATH HOME TERM 7 | export ENV=$HOME/.kshrc 8 | -------------------------------------------------------------------------------- /home/.urlview: -------------------------------------------------------------------------------- 1 | COMMAND chrome %s & 2 | -------------------------------------------------------------------------------- /home/.vim/after/ftplugin/c.vim: -------------------------------------------------------------------------------- 1 | " the smartest indent engine for C 2 | setlocal cindent 3 | " customize indentation for BSD style 4 | setlocal cino="Ls,:0,l1,t0,(s,U1,W4" 5 | 6 | " show trailing whitespace 7 | " let c_space_errors=1 8 | 9 | " for quickfix errorformat 10 | compiler clang 11 | " shows long build messages better 12 | setlocal ch=2 13 | 14 | " auto-create folds per grammar 15 | setlocal foldmethod=syntax 16 | setlocal foldlevel=10 17 | 18 | setlocal path=.,,*/include/**2,./*/include/**2 19 | setlocal path+=/usr/include/**4,/usr/local/include/**3 20 | 21 | setlocal tags=./tags,**5/tags,tags;~ 22 | " ^ in working dir, or parents 23 | " ^ in any subfolder of working dir 24 | " ^ sibling of open file 25 | 26 | " the default is menu,preview but the preview window is annoying 27 | setlocal completeopt=menu 28 | 29 | iabbrev #i #include 30 | iabbrev #d #define 31 | iabbrev main() int main(int argc, char **argv) 32 | 33 | " add #include guard 34 | iabbrev #g =toupper(substitute(expand("%:p:h:t") . "_" . expand("%:t:r") . "_H", "[^a-z]", "_", "ig"))yypki#ifndef j0i#define o#endif2ki 35 | 36 | " run cdecl on line 37 | nmap d :echo system('cdecl -x C99', 'explain ' . substitute(getline('.'), '=.*', '', '')) 38 | 39 | " Adapted from Jason Duell's cscope settings 40 | if has("cscope") 41 | " place results into quickfix, and clear it each time 42 | setlocal cscopequickfix=s-,c-,d-,i-,t-,e-,a- 43 | 44 | " show parent directory name in file path 45 | setlocal cscopepathcomp=2 46 | 47 | " steal the CTRL-] key 48 | setlocal cst 49 | 50 | " attempt to connect quietly 51 | setlocal nocsverb 52 | " add any database in current directory 53 | if filereadable("cscope.out") 54 | cs add cscope.out 55 | " else add database pointed to by environment 56 | elseif $CSCOPE_DB != "" 57 | cs add $CSCOPE_DB 58 | endif 59 | setlocal csverb 60 | 61 | " 's' symbol: find all references to the token under cursor 62 | " 'g' global: find global definition(s) of the token under cursor 63 | " 'c' calls: find all calls to the function name under cursor 64 | " 't' text: find all instances of the text under cursor 65 | " 'e' egrep: egrep search for the word under cursor 66 | " 'f' file: open the filename under cursor 67 | " 'i' includes: find files that include the filename under cursor 68 | " 'd' called: find functions that function under cursor calls 69 | nmap s :cs find s =expand("") 70 | nmap g :cs find g =expand("") 71 | nmap c :cs find c =expand("") 72 | nmap t :cs find t =expand("") 73 | nmap e :cs find e =expand("") 74 | nmap f :cs find f =expand("") 75 | nmap i :cs find i ^=expand("")$ 76 | nmap d :cs find d =expand("") 77 | 78 | " Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) 79 | " split vertically, with search result displayed in 80 | " the new window. 81 | nmap s :vert scs find s =expand("") 82 | nmap g :vert scs find g =expand("") 83 | nmap c :vert scs find c =expand("") 84 | nmap t :vert scs find t =expand("") 85 | nmap e :vert scs find e =expand("") 86 | nmap f :vert scs find f =expand("") 87 | nmap i :vert scs find i ^=expand("")$ 88 | nmap d :vert scs find d =expand("") 89 | 90 | " Hitting CTRL-space *twice* does a horizontal 91 | " split instead of a vertical one 92 | nmap s :scs find s =expand("") 93 | nmap g :scs find g =expand("") 94 | nmap c :scs find c =expand("") 95 | nmap t :scs find t =expand("") 96 | nmap e :scs find e =expand("") 97 | nmap f :scs find f =expand("") 98 | nmap i :scs find i ^=expand("")$ 99 | nmap d :scs find d =expand("") 100 | endif 101 | -------------------------------------------------------------------------------- /home/.vim/after/ftplugin/sh.vim: -------------------------------------------------------------------------------- 1 | " for quickfix errorformat 2 | compiler shellcheck 3 | -------------------------------------------------------------------------------- /home/.vim/after/ftplugin/todo.vim: -------------------------------------------------------------------------------- 1 | setlocal formatlistpat=^\s*[-*x]\s* 2 | setlocal formatoptions=tcroqan 3 | setlocal autoindent 4 | 5 | setlocal tabstop=2 6 | setlocal shiftwidth=2 7 | 8 | setlocal tw=60 9 | 10 | " setlocal foldmethod=expr 11 | " setlocal foldexpr=strlen(substitute(getline(v:lnum),'^\\(\(\\s\|-\|x)*\\).*','\\1','')) 12 | -------------------------------------------------------------------------------- /home/.vim/backup/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/begriffs/obsd/e69bcffafb6c6328ba6ab3eaa09d8a4ca39617ee/home/.vim/backup/.gitkeep -------------------------------------------------------------------------------- /home/.vim/compiler/clang.vim: -------------------------------------------------------------------------------- 1 | " vim compiler file 2 | " Compiler: LLVM clang 3 | " Maintainer: Joe Nelson 4 | " Last Change: 2019 Jun 29 5 | 6 | " allow user plugin to override, can remove this 7 | " guard if installing to personal runtime directory 8 | if exists("current_compiler") 9 | finish 10 | endif 11 | let current_compiler = "clang" 12 | 13 | " for older vim versions 14 | if exists(":CompilerSet") != 2 15 | command -nargs=* CompilerSet setlocal 16 | endif 17 | 18 | " formatting variations documented at 19 | " https://clang.llvm.org/docs/UsersManual.html#formatting-of-diagnostics 20 | " 21 | " It should be possible to make this work for the combination of 22 | " -fno-show-column and -fcaret-diagnostics as well with multiline 23 | " and %p, but I was too lazy to figure it out. 24 | " 25 | " The %D and %X patterns are not clang per se. They capture the directory 26 | " change messages from (GNU) 'make -w'. I needed this for building a project 27 | " which used recursive Makefiles. 28 | 29 | CompilerSet errorformat= 30 | \%f:%l%c:{%*[^}]}{%*[^}]}:\ %trror:\ %m, 31 | \%f:%l%c:{%*[^}]}{%*[^}]}:\ %tarning:\ %m, 32 | \%f:%l:%c:\ %trror:\ %m, 33 | \%f:%l:%c:\ %tarning:\ %m, 34 | \%f(%l,%c)\ :\ %trror:\ %m, 35 | \%f(%l,%c)\ :\ %tarning:\ %m, 36 | \%f\ +%l%c:\ %trror:\ %m, 37 | \%f\ +%l%c:\ %tarning:\ %m, 38 | \%f:%l:\ %trror:\ %m, 39 | \%f:%l:\ %tarning:\ %m, 40 | \%D%*\\a[%*\\d]:\ Entering\ directory\ %*[`']%f', 41 | \%D%*\\a:\ Entering\ directory\ %*[`']%f', 42 | \%X%*\\a[%*\\d]:\ Leaving\ directory\ %*[`']%f', 43 | \%X%*\\a:\ Leaving\ directory\ %*[`']%f', 44 | \%DMaking\ %*\\a\ in\ %f 45 | 46 | CompilerSet makeprg=make 47 | -------------------------------------------------------------------------------- /home/.vim/ftdetect/todo.vim: -------------------------------------------------------------------------------- 1 | autocmd BufNewFile,BufRead *.todo setf todo 2 | -------------------------------------------------------------------------------- /home/.vim/swap/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/begriffs/obsd/e69bcffafb6c6328ba6ab3eaa09d8a4ca39617ee/home/.vim/swap/.gitkeep -------------------------------------------------------------------------------- /home/.vim/undo/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/begriffs/obsd/e69bcffafb6c6328ba6ab3eaa09d8a4ca39617ee/home/.vim/undo/.gitkeep -------------------------------------------------------------------------------- /home/.vimrc: -------------------------------------------------------------------------------- 1 | " put the m in vim 2 | set nocompatible 3 | 4 | " use CTRL-G to show position 5 | set noruler 6 | 7 | filetype plugin indent on 8 | syntax on 9 | 10 | " decent colors that ship with vim 11 | colorscheme pablo 12 | 13 | " tabs for indentation, spaces for alignment 14 | set noexpandtab 15 | set tabstop=4 16 | set shiftwidth=4 17 | 18 | " I can figure it out w/o a beep 19 | set belloff=all 20 | 21 | " wrapping can be confusing 22 | set nowrapscan 23 | 24 | " be smart about case 25 | set ignorecase 26 | set smartcase 27 | 28 | set backspace=eol,indent,start 29 | 30 | " real make 31 | map :make 32 | " GNUism, for building postgres 33 | map :make -w 34 | 35 | map :copen 36 | map :cclose 37 | 38 | " fuzzy-find lite 39 | nmap :e **/ 40 | 41 | " quickfix shortcuts 42 | nmap ]q :cnext 43 | nmap ]Q :clast 44 | nmap [q :cprev 45 | nmap [Q :cfirst 46 | 47 | " formatting is more common than Ex mode 48 | nmap Q gq 49 | vmap Q gq 50 | 51 | " mouse can be useful, enable in normal mode 52 | set mouse=n 53 | 54 | " pop vertical splits to the right, not left 55 | set splitright 56 | 57 | " more shell-like tab completion 58 | set wildmode=longest,list,full 59 | set wildmenu 60 | 61 | " show subfolders as ascii tree 62 | let g:netrw_liststyle = 3 63 | " hide help banner -- you can show it with 'I' 64 | let g:netrw_banner = 0 65 | " don't show object files 66 | let g:netrw_list_hide = "\.[oa]$" 67 | 68 | " use a more readable diff algorithm 69 | if has("patch-8.1.0360") 70 | set diffopt+=internal,algorithm:patience 71 | endif 72 | 73 | " Protect changes before writes. Default values of 74 | " updatecount (200 " keystrokes) and updatetime 75 | " (4 seconds) are fine 76 | set swapfile 77 | " hint: mount on a fast fs when possible 78 | set directory^=~/.vim/swap// 79 | 80 | " persist the undo tree for each file 81 | set undofile 82 | set undodir^=~/.vim/undo// 83 | 84 | " protect against crash-during-write 85 | set writebackup 86 | " but do not persist backup after successful write 87 | set nobackup 88 | " rename-and-write-new method whenever safe 89 | set backupcopy=auto 90 | " patch required to honor double slash at end 91 | if has("patch-8.1.0251") 92 | " consolidate the writebackups -- not a big 93 | " deal either way, since they usually get deleted 94 | set backupdir^=~/.vim/backup// 95 | end 96 | 97 | " shortcuts for 3-way merge 98 | map 1 :diffget LOCAL 99 | map 2 :diffget BASE 100 | map 3 :diffget REMOTE 101 | -------------------------------------------------------------------------------- /home/.weechat/irc.conf: -------------------------------------------------------------------------------- 1 | # 2 | # weechat -- irc.conf 3 | # 4 | # WARNING: It is NOT recommended to edit this file by hand, 5 | # especially if WeeChat is running. 6 | # 7 | # Use /set or similar command to change settings in WeeChat. 8 | # 9 | # For more info, see: https://weechat.org/doc/quickstart 10 | # 11 | 12 | [look] 13 | buffer_open_before_autojoin = on 14 | buffer_open_before_join = off 15 | buffer_switch_autojoin = on 16 | buffer_switch_join = on 17 | color_nicks_in_names = off 18 | color_nicks_in_nicklist = off 19 | color_nicks_in_server_messages = on 20 | color_pv_nick_like_channel = on 21 | ctcp_time_format = "%a, %d %b %Y %T %z" 22 | display_away = local 23 | display_ctcp_blocked = on 24 | display_ctcp_reply = on 25 | display_ctcp_unknown = on 26 | display_host_join = on 27 | display_host_join_local = on 28 | display_host_quit = on 29 | display_join_message = "329,332,333,366" 30 | display_old_topic = on 31 | display_pv_away_once = on 32 | display_pv_back = on 33 | highlight_channel = "$nick" 34 | highlight_pv = "$nick" 35 | highlight_server = "$nick" 36 | highlight_tags_restrict = "irc_privmsg,irc_notice" 37 | item_channel_modes_hide_args = "k" 38 | item_display_server = buffer_plugin 39 | item_nick_modes = on 40 | item_nick_prefix = on 41 | join_auto_add_chantype = off 42 | msgbuffer_fallback = current 43 | new_channel_position = none 44 | new_pv_position = none 45 | nick_completion_smart = speakers 46 | nick_mode = prefix 47 | nick_mode_empty = off 48 | nicks_hide_password = "nickserv" 49 | notice_as_pv = auto 50 | notice_welcome_redirect = on 51 | notice_welcome_tags = "" 52 | notify_tags_ison = "notify_message" 53 | notify_tags_whois = "notify_message" 54 | part_closes_buffer = off 55 | pv_buffer = independent 56 | pv_tags = "notify_private" 57 | raw_messages = 256 58 | server_buffer = merge_with_core 59 | smart_filter = on 60 | smart_filter_delay = 5 61 | smart_filter_join = on 62 | smart_filter_join_unmask = 30 63 | smart_filter_mode = "+" 64 | smart_filter_nick = on 65 | smart_filter_quit = on 66 | temporary_servers = off 67 | topic_strip_colors = off 68 | 69 | [color] 70 | input_nick = lightcyan 71 | item_channel_modes = default 72 | item_lag_counting = default 73 | item_lag_finished = yellow 74 | item_nick_modes = default 75 | message_join = green 76 | message_quit = red 77 | mirc_remap = "1,-1:darkgray" 78 | nick_prefixes = "y:lightred;q:lightred;a:lightcyan;o:lightgreen;h:lightmagenta;v:yellow;*:lightblue" 79 | notice = green 80 | reason_quit = default 81 | topic_current = default 82 | topic_new = white 83 | topic_old = default 84 | 85 | [network] 86 | autoreconnect_delay_growing = 2 87 | autoreconnect_delay_max = 600 88 | ban_mask_default = "*!$ident@$host" 89 | channel_encode = off 90 | colors_receive = on 91 | colors_send = on 92 | lag_check = 60 93 | lag_max = 1800 94 | lag_min_show = 500 95 | lag_reconnect = 300 96 | lag_refresh_interval = 1 97 | notify_check_ison = 1 98 | notify_check_whois = 5 99 | sasl_fail_unavailable = on 100 | send_unknown_commands = off 101 | whois_double_nick = off 102 | 103 | [msgbuffer] 104 | 105 | [ctcp] 106 | 107 | [ignore] 108 | 109 | [server_default] 110 | addresses = "" 111 | anti_flood_prio_high = 2 112 | anti_flood_prio_low = 2 113 | autoconnect = off 114 | autojoin = "" 115 | autoreconnect = on 116 | autoreconnect_delay = 10 117 | autorejoin = off 118 | autorejoin_delay = 30 119 | away_check = 0 120 | away_check_max_nicks = 25 121 | capabilities = "" 122 | command = "" 123 | command_delay = 0 124 | connection_timeout = 60 125 | ipv6 = on 126 | local_hostname = "" 127 | msg_kick = "" 128 | msg_part = "WeeChat ${info:version}" 129 | msg_quit = "WeeChat ${info:version}" 130 | nicks = "memyself,memyself1,memyself2,memyself3,memyself4" 131 | nicks_alternate = on 132 | notify = "" 133 | password = "" 134 | proxy = "" 135 | realname = "" 136 | sasl_fail = continue 137 | sasl_key = "" 138 | sasl_mechanism = plain 139 | sasl_password = "" 140 | sasl_timeout = 15 141 | sasl_username = "" 142 | split_msg_max_length = 512 143 | ssl = off 144 | ssl_cert = "" 145 | ssl_dhkey_size = 2048 146 | ssl_fingerprint = "" 147 | ssl_priorities = "NORMAL:-VERS-SSL3.0" 148 | ssl_verify = on 149 | usermode = "" 150 | username = "myusername" 151 | 152 | [server] 153 | freenode.addresses = "chat.freenode.net/7000" 154 | freenode.proxy 155 | freenode.ipv6 156 | freenode.ssl = on 157 | freenode.ssl_cert 158 | freenode.ssl_priorities 159 | freenode.ssl_dhkey_size 160 | freenode.ssl_fingerprint 161 | freenode.ssl_verify 162 | freenode.password 163 | freenode.capabilities 164 | freenode.sasl_mechanism 165 | freenode.sasl_username = "foobar" 166 | freenode.sasl_password = "bazbat" 167 | freenode.sasl_key 168 | freenode.sasl_timeout 169 | freenode.sasl_fail 170 | freenode.autoconnect = on 171 | freenode.autoreconnect 172 | freenode.autoreconnect_delay 173 | freenode.nicks = "foobar" 174 | freenode.nicks_alternate 175 | freenode.username = "foobar" 176 | freenode.realname = "Me Myself" 177 | freenode.local_hostname 178 | freenode.usermode 179 | freenode.command 180 | freenode.command_delay 181 | freenode.autojoin = "#postgresql,#postgresql-lounge,##c,#openbsd,#workingset,#posix" 182 | freenode.autorejoin 183 | freenode.autorejoin_delay 184 | freenode.connection_timeout 185 | freenode.anti_flood_prio_high 186 | freenode.anti_flood_prio_low 187 | freenode.away_check 188 | freenode.away_check_max_nicks 189 | freenode.msg_kick 190 | freenode.msg_part 191 | freenode.msg_quit 192 | freenode.notify 193 | freenode.split_msg_max_length 194 | -------------------------------------------------------------------------------- /home/.xsession: -------------------------------------------------------------------------------- 1 | export LANG=en_US.UTF-8 2 | export ENV=$HOME/.kshrc 3 | 4 | xset -b 5 | setxkbmap -option ctrl:nocaps 6 | i3 7 | -------------------------------------------------------------------------------- /home/bin/cool: -------------------------------------------------------------------------------- 1 | sct 2 | -------------------------------------------------------------------------------- /home/bin/dock: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | xrandr --output HDMI-1 --auto 5 | xrandr --output LVDS-1 --off 6 | 7 | doas /sbin/sysctl machdep.lidaction=0 8 | 9 | touch $HOME/.config/check-mail 10 | -------------------------------------------------------------------------------- /home/bin/ftdi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | speed=${1-38400} 4 | cu -s $speed -l cuaU1 5 | -------------------------------------------------------------------------------- /home/bin/npsubfm: -------------------------------------------------------------------------------- 1 | curl -N -H 'Icy-MetaData: 1' http://fmsub.radioca.st/Sub.FM 2>/dev/null | sed -n "/.*StreamTitle='\(.*\)';.*/{s//\1/p;q;}" 2 | -------------------------------------------------------------------------------- /home/bin/open-selection-chrome.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /usr/local/bin/chrome "$(xclip -o)" & 4 | -------------------------------------------------------------------------------- /home/bin/open-selection-vim.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /usr/X11R6/bin/xterm -e /usr/local/bin/vim "$(xclip -o)" 4 | -------------------------------------------------------------------------------- /home/bin/reset-audio: -------------------------------------------------------------------------------- 1 | # from the obsd multimedia FAQ 2 | 3 | doas rcctl set sndiod flags -f rsnd/0 -F rsnd/1 4 | doas rcctl restart sndiod 5 | -------------------------------------------------------------------------------- /home/bin/semrm: -------------------------------------------------------------------------------- 1 | ipcs -a | tail -n 4 | awk '{print $2}' | xargs -L 1 ipcrm -s 2 | -------------------------------------------------------------------------------- /home/bin/subfm: -------------------------------------------------------------------------------- 1 | ffplay -nodisp -loglevel info http://fmsub.radioca.st/Sub.FM 2 | -------------------------------------------------------------------------------- /home/bin/undock: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | xrandr --output LVDS-1 --auto 5 | xrandr --output HDMI-1 --off 6 | 7 | doas /sbin/sysctl machdep.lidaction=1 8 | 9 | rm $HOME/.config/check-mail 10 | -------------------------------------------------------------------------------- /home/bin/upgrade: -------------------------------------------------------------------------------- 1 | ftp https://cloudflare.cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/bsd.rd 2 | ftp https://cloudflare.cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/SHA256.sig 3 | signify -Cp /etc/signify/openbsd-64-base.pub -x SHA256.sig bsd.rd 4 | 5 | echo "If that looked good..." 6 | echo "Copy bsd.rd to the root, boot off it and U" 7 | echo "After boot, do pkg_add -u and fw_update" 8 | -------------------------------------------------------------------------------- /home/bin/vol: -------------------------------------------------------------------------------- 1 | mixerctl outputs.master=$1,$1 2 | -------------------------------------------------------------------------------- /home/bin/warm: -------------------------------------------------------------------------------- 1 | sct 4500 2 | -------------------------------------------------------------------------------- /home/crontab: -------------------------------------------------------------------------------- 1 | */15 * * * * /bin/test -e /home/j/.config/check-mail && /usr/local/bin/mbsync -a 2 | -------------------------------------------------------------------------------- /packages.txt: -------------------------------------------------------------------------------- 1 | bison-3.3.2p2 GNU parser generator 2 | colordiff-1.0.19 colorized diff tool 3 | firefox-88.0.1 Firefox web browser 4 | geoclue2-2.4.13 modular geoinformation service on top of D-Bus 5 | git-2.31.1 distributed version control system 6 | hexchat-2.14.3p0 GTK+2 IRC Client 7 | i3-4.19.2 improved dynamic tiling window manager 8 | intel-firmware-20210608v0 microcode update binaries for Intel CPUs 9 | inteldrm-firmware-20201218 firmware binary images for inteldrm(4) driver 10 | isync-1.4.1p0 synchronize IMAP4 and maildir mailboxes 11 | iwn-firmware-5.11p1 firmware binary images for iwn(4) driver 12 | jasper-2.0.14 reference implementation of JPEG-2000 13 | lynx-2.8.9rel1p0 text web browser 14 | msmtp-1.8.7 SMTP plugin for MUAs 15 | mutt-2.0.6v3-gpgme-sasl tty-based e-mail client 16 | py3-gobject3-3.38.0p1 Python bindings for GLib and GObject 17 | py3-xdg-0.27 python library to access freedesktop.org standards 18 | quirks-3.633 exceptions to pkg_add rules 19 | sct-0.5 set the color temperature of the screen 20 | urlview-0.9p8 curses-based URL ripper 21 | uvideo-firmware-1.2p3 firmware binary images for uvideo(4) driver 22 | vim-8.2.2580-no_x11 vi clone, many additional features 23 | vlc-3.0.12p0 VideoLAN client; multimedia player 24 | w3m-0.5.3pl20210102p0 pager/text-based web browser 25 | --------------------------------------------------------------------------------