Tuesday, October 27, 2009

cmdhere on win7

Shift + right-click shows a context menu with additional entries such as Open command window here.

To add Open powershell here with and without elevated privileges:
  1. Windows Registry Editor Version 5.00
  2. [HKEY_CLASSES_ROOT\Directory\shell\ps]
  3. @="Open powershell here"
  4. [HKEY_CLASSES_ROOT\Directory\shell\ps\command]
  5. @="C:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
  6. [HKEY_CLASSES_ROOT\Directory\shell\Runas]
  7. @="Open admin powershell here"
  8. [HKEY_CLASSES_ROOT\Directory\shell\Runas\Command]
  9. @="C:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
  10. [HKEY_CLASSES_ROOT\Drive\shell\ps]
  11. @="Open powershell here"
  12. [HKEY_CLASSES_ROOT\Drive\shell\ps\command]
  13. @="C:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
  14. [HKEY_CLASSES_ROOT\Drive\shell\runas]
  15. @="Open powershell admin here"
  16. [HKEY_CLASSES_ROOT\Drive\shell\runas\command]
  17. @="C:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
Keys having runas in their names are the ones that will trigger elevated privileges. So yes, it seems we can only map one elevated command per HKEY_CLASSES_ROOT key...

run as admin on win7

win+r
Type command
ctrl-shift-enter
alt-y

Tuesday, October 20, 2009

overloading SEL_KEYPRESS

Or something like that...

The idea is to get some widget to do not only what it's supposed to, but also something else. For example, I would really want to hear the buzzing sound of a fly whenever I press Ctrl-z in some FXText.
  1. require 'fox16'
  2. require 'fox16/responder'
  3. include Fox

  4. class BuzzingText < FXText

  5.   include Responder

  6.   def initialize p
  7.     super p
  8.     FXMAPFUNC(SEL_KEYPRESS, 0, :onKeyPress)
  9.   end

  10.   def onKeyPress sender, sel, event
  11.     super sender, sel, event
  12. if (event.state & CONTROLMASK != 0) and (event.code == KEY_z)
  13.       # buzz
  14. end
  15.   end

  16. end

Wednesday, October 14, 2009

Avira AntiVir moins gossant

EDIT (2010-04-08): J'utilise maintenant Avast! et il n'y a aucun popup en utilisant le "gaming mode".

EDIT (2009-10-27): Les fucking popups gossants sont revenus. Je songe sérieusement à désinstaller ce logiciel et me trouver un autre anti-virus.

Je trouvais AVG trop lourd et selon les tests de quelques personnes, AntiVir est plus efficace à trouver les virus. Je me décide donc à l'installer, sous win7.

Horreur, à chaque update (plus d'une fois par jour?), je vois un maudit popup qui m'énarve avec sa version premium payante. Enlevons ça:
  • Right-click sur avnotify.exe dans le répertoire correspondant de "Program Files";
  • Properties;
  • Security tab;
  • Éditer les permissons en cochant "Deny" pour tous les users.

Certains utilisateurs se plaignaient aussi de l'updater qui démarre en mode minimized, apparemment chiant quand on roule une application full-screen. On peut démarrer l'updater en mode invisible, comme suit:
  • Popper l'interface;
  • Administration;
  • Scheduler;
  • Right-click "Daily Update";
  • 3 fois "Next >";
  • Changer à "invisible";
  • Finish.
Ref: http://www.tipsfor.us/2009/03/18/avira-antivir-updates-to-version-9-make-it-more-usable/

Thursday, October 8, 2009

updated editor?

Using blogger as a way to store useful technical information for later consultation seemed a good idea. I wanted some kind of content management for some time now because keeping notes in plain text files is boring and difficult to search through. And I wanted links. I never finished the 2 or 3 different versions of scripts for tagging or grouping this kind of stuff and these blogging software already got it all.

And if anything here can be of use to someone else, then all the better. I also think that comments are a good way to dig deeper into problems if anything needs clarification. It'll sharpen my writing. And maybe I'll have interesting conversations with other people! All this looks promising.

But the supposedly updated editor of this blog seems crap. I have to edit the HTML code to remove curious and annoying "span" and "div" blocks. Although things look nice in the "compose" tab, when I preview (or post), these blocks put blank spaces on the page. The "remove formatting" button does not seem to remove them all.

require 'that'

$LOAD_PATH.unshift(
  File.join(
    File.expand_path(File.dirname(__FILE__)), 'lib'
  )
)

refs: http://blog.8thlight.com/articles/2007/10/08/micahs-general-guidelines-on-ruby-requirehttp://stuff.lilleaas.net/load_path

Wednesday, October 7, 2009

About network security and tunneling

"This paper demonstrates how to encapsulate any TCP-based protocol (SMTP, POP3, NNTP, telnet...) into HTTP"
Punching holes into firewalls

or "Why firewalls shouldn't be considered a ultimate weapon for network security"
or "Secure TCP-into-HTTP tunnelling guide"

http://sebsauvage.net/punching/

Saturday, October 3, 2009

UAC, and Configuring GVim on Windows 7

With all this new stuff about user access control (UAC), I tend to use Windows much more in the same way that I would use another Unix OS. The default UAC settings let us know each time we must
use admin privileges to do something crazy on the computer.

Using Windows XP, it would be a pain to switch to an admin account everytime we want to do this crazy something. Because of this, I'm logged on admin full time when using XP, and I don't like it. (If anyone knows another way, please tell me, or not because I won't use it anymore). I'm glad this has changed. I think Vista also has this feature, but since it was Vista, I didn't care.

All this to talk about Gvim's startup settings file, located under a system folder (Program Files). Under XP, I changed the settings right in this file. Of course, I would never do that under Ubuntu --- I have this file hidden right in the root of my "home" directory, as it is with pretty much any other software. Under 7, I was quickly reminded that I needed admin privileges to change it. "Good lord," I thought to myself, "Not only Windows became more multi-user friendly, it even tells me to behave well!". Good. Put your config files at home, you bastards.

Anyways, to change startup settings, I copied _vimrc from vim's folder into my home directory. To set font to "Lucida Console", height 12, width 6.5:
  1. set guifont=Lucida_Console:h12:w6.5
Backup and swap files are annoying:
  1. set nobackup nowritebackup noswapfile
Also,
  1. syntax on
  2. colorscheme darkblue
Doc: http://www.vim.org/htmldoc/options.html