XP Crash On Ctrl Scroll

1. Start regedit.
2. Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters
3. Create a new DWORD value and name it CrashOnCtrlScroll
4. Right-click on this newly created value and click on Modify
5. Enter 1 in the Value data field and click on OK.
6. Close regedit and reboot your system.
7. Now you can blue screen (crash) your system by holding the right CTRL key and pressing "Scroll Lock" twice.

Note:

Your system may reboot or show a blue screen whenever this crash is initiated. If your system reboots after initiating the crash, and you want to see the blue screen, follow these steps:

1. Go to Control Panel > System
2. Click on the Advanced tab
3. Under Startup and Recovery, click the Settings button.
4. Under System failure, uncheck the option Automatically restart.
Udgivet i Knowledge Base, Windows | Skriv en kommentar

finding i2c chips on linux 2.6

compile the i2c subsystem and the correct bus driver

        <*> I2C support
        <*>   I2C device interface
              I2C Algorithms  --->
                 <*> I2C bit-banging interfaces
              I2C Hardware Bus support  --->
                 <*> Intel 801
                 <*> ISA Bus support
              Hardware Sensors Chip support  ---> 
                 all: <M>

now run this cmd:
for module in `modprobe -l | grep i2c/chips | cut -d / -f 9 | cut -d . -f 1` ; \
do modprobe ${module} ; echo ${module} loaded. if anything here, module succeeded: ; \
ls /sys/bus/i2c/devices/ ; read ; rmmod ${module} ; echo ${module} unloaded ; done
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Generating random high secure passwords in freebsd

On freebsd:
jot -r -c 160 a1 { | rs -g 0 10

Output:
$ jot -r -c 160 a1 { | rs -g 0 10
7ZSEiPOEeq
YO^oJfZ6D[
lgC2Invit?
pPKkukm4gV
8\Nbl^inS4
AQIK9]S=[?
Apvt5Z[CX^
1VI3EM]_J3
iGPo\7F@g]
hC=dis[D>E
=CYIGDHHwp
^<3OhDyHNI
_>]VH6t>fE
4AVuNXldsO
Iab7YN;A:k
B6qvnY17NV
Www.Dreamless.Dk
Udgivet i FreeBSD, Knowledge Base, Old Base | Skriv en kommentar

Delphi: How to Add a Splash Screen to Your Application

From: http://info.borland.com/devsupport/delphi/devcorner/techtips/splash.html
Splash Screens are important to your applications. They provide function while adding to your application's visual appearance and interface. Splash Screens communicate with users of your application.

Using Splash Screens in your applications can uniquely distinguish yours from the others.

There are many types of Splash Screens. The most common Splash Screens are the ones you see when an application is first being loaded. These usually display the application's name, author, version, copyright, and image or icon that uniqely identifies it.

However, some applications use Splash Screens to display and notify the user of the progress of a time-consuming process. An example would be a SplashScreen that communicates the percentage of completetion of a databasetask, file task, or numeric processing tasks. The Progress Splash Screen offers users the courtesy of being informed.

You now see the benefits of Splash Screen. Let's show you how to create a simple one for yourself.

   1. Add a form to your project --> File | New Form.. Commentary: A Splash Screen is like any other form.
   2. Change the Name Property of the Form to SplashScreen
   3. Change the BorderStyle Property of the Form to bsNone
   4. Change the Position Property of the Form to poScreenCenter
   5. Customize your Splash Screen by adding various Components on the Form. (Labels, Panels, Images, Shapes, and Bevels)
   6. Edit the Properties of the added Components
   7. Select Options | Project from the Delphi IDE Menu
   8. Move the SplashScreen Form from the Auto-create listbox

      Commentary: You'll create a dynamic instance of the Splash Screen
   9. Add the unit containing TSplashScreen to the uses clause of your application's main form. Example:

          unit Unit1;             
          interface             
          uses SysUtils, WinTypes, WinProcs, Messages, Classes,                
               Graphics, Controls, Forms, Dialogs, StdCtrls,                
               unit2;  <---- put here

      Commentary: In this example, TSplashScreen has been declared in Unit2
  10. Select View | Project Source from the Delphi IDE Menu
  11. Add the following code after the begin statement and before any of the Application.Create() statements Code Addition:

          SplashScreen := TSplashScreen.Create(Application);              
          SplashScreen.Show;              
          SplashScreen.Refresh;

  12. Edit the OnShow event of your application's main form. Add the following code. Code Addition:

          SplashScreen.Free;

      Commentary: The implementation of a Progress Splash Screen is not much different than this example. The concept is that you create and show the splash screen before a process and free it after the process is completed. The difference is that you may want to talk back and forth between the process and the Splash Screen to update the progress.
  13. Run the Application. In this example, depending on the speed of your machine, you will barely see your new Splash Screen. You could add the following code to view your Splash Screen-- but we suggest that you use caution if you implement this technique in your application.

      Add this code immediately following the code addition in step #11 Code Addition:

         for x:= 1 to 10000000 do               
         begin                 
           x:=x;
         end;\

*************************************************
{PROJECT1.DPR}
program Project1;
uses
  Forms,
  Unit1 in 'UNIT1.PAS' {Form1},
  Unit2 in 'UNIT2.PAS' {SplashScreen};
{$R *.RES}
var
  x: longint;
begin
  SplashScreen:= TSplashScreen.Create(Application);
  SplashScreen.Show;
  SplashScreen.Refresh;;
  for x:= 1 to 10000000 do
  begin
    x:=x;
    x:=x;
  end;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
*************************************************
{UNIT1.PAS}
unit Unit1;
interface
uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, unit2;
type
  TForm1 = class(TForm)
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormShow(Sender: TObject);
begin
  splashscreen.free;
end;
end.
*************************************************
{UNIT2.PAS}
unit Unit2;
interface
uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, ExtCtrls;
type
  TSplashScreen = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Shape1: TShape;
    Shape2: TShape;
    Shape3: TShape;
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  SplashScreen: TSplashScreen;
implementation
{$R *.DFM}
end.
Udgivet i Old Base, Programmering | Skriv en kommentar

Delphi: How to Add a Splash Screen to Your Application

From: http://info.borland.com/devsupport/delphi/devcorner/techtips/splash.html

Splash Screens are important to your applications. They provide function while adding to your application's visual appearance and interface. Splash Screens communicate with users of your application.

Using Splash Screens in your applications can uniquely distinguish yours from the others.

There are many types of Splash Screens. The most common Splash Screens are the ones you see when an application is first being loaded. These usually display the application's name, author, version, copyright, and image or icon that uniqely identifies it.

However, some applications use Splash Screens to display and notify the user of the progress of a time-consuming process. An example would be a SplashScreen that communicates the percentage of completetion of a databasetask, file task, or numeric processing tasks. The Progress Splash Screen offers users the courtesy of being informed.

You now see the benefits of Splash Screen. Let's show you how to create a simple one for yourself.

   1. Add a form to your project --> File | New Form.. Commentary: A Splash Screen is like any other form.
   2. Change the Name Property of the Form to SplashScreen
   3. Change the BorderStyle Property of the Form to bsNone
   4. Change the Position Property of the Form to poScreenCenter
   5. Customize your Splash Screen by adding various Components on the Form. (Labels, Panels, Images, Shapes, and Bevels)
   6. Edit the Properties of the added Components
   7. Select Options | Project from the Delphi IDE Menu
   8. Move the SplashScreen Form from the Auto-create listbox

      Commentary: You'll create a dynamic instance of the Splash Screen
   9. Add the unit containing TSplashScreen to the uses clause of your application's main form. Example:

          unit Unit1;             
          interface             
          uses SysUtils, WinTypes, WinProcs, Messages, Classes,                
               Graphics, Controls, Forms, Dialogs, StdCtrls,                
               unit2;  <---- put here

      Commentary: In this example, TSplashScreen has been declared in Unit2
  10. Select View | Project Source from the Delphi IDE Menu
  11. Add the following code after the begin statement and before any of the Application.Create() statements Code Addition:

          SplashScreen := TSplashScreen.Create(Application);              
          SplashScreen.Show;              
          SplashScreen.Refresh;

  12. Edit the OnShow event of your application's main form. Add the following code. Code Addition:

          SplashScreen.Free;

      Commentary: The implementation of a Progress Splash Screen is not much different than this example. The concept is that you create and show the splash screen before a process and free it after the process is completed. The difference is that you may want to talk back and forth between the process and the Splash Screen to update the progress.
  13. Run the Application. In this example, depending on the speed of your machine, you will barely see your new Splash Screen. You could add the following code to view your Splash Screen-- but we suggest that you use caution if you implement this technique in your application.

      Add this code immediately following the code addition in step #11 Code Addition:

         for x:= 1 to 10000000 do               
         begin                 
           x:=x;
         end;\

*************************************************
{PROJECT1.DPR}
program Project1;
uses
  Forms,
  Unit1 in 'UNIT1.PAS' {Form1},
  Unit2 in 'UNIT2.PAS' {SplashScreen};
{$R *.RES}
var
  x: longint;
begin
  SplashScreen:= TSplashScreen.Create(Application);
  SplashScreen.Show;
  SplashScreen.Refresh;;
  for x:= 1 to 10000000 do
  begin
    x:=x;
    x:=x;
  end;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
*************************************************
{UNIT1.PAS}
unit Unit1;
interface
uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, unit2;
type
  TForm1 = class(TForm)
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormShow(Sender: TObject);
begin
  splashscreen.free;
end;
end.
*************************************************
{UNIT2.PAS}
unit Unit2;
interface
uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, ExtCtrls;
type
  TSplashScreen = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Shape1: TShape;
    Shape2: TShape;
    Shape3: TShape;
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  SplashScreen: TSplashScreen;
implementation
{$R *.DFM}
end.
Udgivet i Knowledge Base | Skriv en kommentar

replace with sed

Just a reminder for myself
cat fil.gammel | sed -e 's/gammel/ny/g' > fil.ny
Udgivet i Knowledge Base, Old Base, Shellscript | Skriv en kommentar

Using CVS

Opret CVS:

$ export CVSROOT=/home/cvs/cvsroot
$ cvs init

Skal nu have noget source i vores cvs, vi laver noget fiktiv source:

$ mkdir bigproject
$ cd bigproject
$ touch source1.c
$ touch source2.c
$ touch source3.c
$ mkdir libs
$ cd libs
$ touch lib1.h
$ touch lib2.h
$ touch lib3.h
$ cd ..


Vi opretter vores project
$ cvs import -m "" bigproject BigProjectVendor release2
N bigproject/source1.c
N bigproject/source2.c
N bigproject/source3.c
cvs import: Importing /home/cvs/cvsroot/bigproject/libs
N bigproject/libs/lib1.h
N bigproject/libs/lib2.h
N bigproject/libs/lib3.h

No conflicts created by this import

$

Vi rykker lige et nyt sted hen:
$ cd ~
$ mkdir workingdir
$ cd workingdir


Henter en kopi af sovsen:
$ cvs checkout bigproject
cvs checkout: Updating bigproject
U bigproject/source1.c
U bigproject/source2.c
U bigproject/source3.c
cvs checkout: Updating bigproject/libs
U bigproject/libs/lib1.h
U bigproject/libs/lib2.h
U bigproject/libs/lib3.h
$

Redigerer lidt i source1.c

vim source1.c

og opdaterer cvs'en igen:
$ cvs commit
cvs commit: Examining .
cvs commit: Examining libs
Du bliver bedt forklare i en vim (default editor) hvad du har gjort ved filerne.
/tmp/cvsYLAmQj: 9 lines, 319 characters.
Checking in source1.c;
/home/cvs/cvsroot/bigproject/source1.c,v  <--  source1.c
new revision: 1.2; previous revision: 1.1
done

Hvis du vil undgaa en tur i vim kan du tilfoeje: -m "I did this and that" til kommandolinie.

og saa er cvs opdateret, naeste gang nogen henter sourcen fra cvs vil dine aendringer vaere med.

Hvis vi antager at vi har et projekt som nu har en fungerende funktion vil vi gerne gemme status quo, så vi skriver:
$ cvs tag working-shit
cvs tag: Tagging .
T source1.c
T source2.c
T source3.c
cvs tag: Tagging libs
T libs/lib1.h
T libs/lib2.h
T libs/lib3.h

Hvorefter vi aendrer i filerne og kommer til at lave noget fuck som vi smider i cvs'en og faar brug for at genskabe de filer igen som virkede og som vi kalder 'release working shit', vi sletter foerst source traaet som det er nu:
rm -fr bigproject


$ cvs checkout -r working-shit bigproject
cvs checkout: Updating bigproject
U bigproject/source1.c
U bigproject/source2.c
U bigproject/source3.c
cvs checkout: Updating bigproject/libs
U bigproject/libs/lib1.h
U bigproject/libs/lib2.h
U bigproject/libs/lib3.h


og we staar nu med working shit releasen!


Fandt lige en cool tutorial: http://www.csc.calpoly.edu/~dbutler/tutorials/winter96/cvs/
Udgivet i Knowledge Base, Old Base, Windows, Workstation | Skriv en kommentar

Vladimirr’s pancakes

Ingredients:
250 gram wheat flour,
6 dl milk, 
4 eggs, 
2-3 teaspoonful sugar, 
1/4 - 1/2 teaspoonful salt
60 gram margarine

HOWTO:
Mix the milk and the flour, add sugar and salt and the 4 eggs and mix it all.
Melt the margarine on the pan and mix it into the batter.

Bake the pancakes medium brown and eat with sugar, syrup, jam or whatever you like. (icecream is also pretty nice)
Vladimirr.dk
Udgivet i Knowledge Base, LifeHack | Skriv en kommentar

Tilpas vindue efter indholds stoerese[IE]

<body leftmargin="0" topmargin="0" rightmargin="0" onblur="self.close();">

<div id='mydiv'>
1blablablalbalbalbalabababfgadZ
2blablablalbalbalbalabababfgadZ
3blablablalbalbalbalabababfgadZ
4blablablalbalbalbalabababfgadZ
</div>
<script>
w=document.all["mydiv"].clientWidth || document.getElementById("mydiv").offsetWidth;
h=document.all["mydiv"].clientHeight || document.getElementById("mydiv").offsetHeight;
document.write(document.body.offsetWidth);
document.write(document.getElementById("mydiv").offsetHeight);
window.resizeTo((document.body.offsetWidth+6),(document.getElementById("mydiv").offsetHeight+30));
</script>
Udgivet i Knowledge Base, Old Base, Programmering | Skriv en kommentar

Stoerelsen paa en div i javascript [IE Only]

<div id='mydiv'>
Hvor hoej er den her crap div??<br><br><br>Saa hoej?
</div>
<script>
height=document.all["mydiv"].clientHeight || document.getElementById("mydiv").offsetHeight
width=document.all["mydiv"].clientWidth || document.getElementById("mydiv").offsetWidth
alert(height+' '+width)
document.write(document.mytab.style.offsetHeight);
</script>
Udgivet i Knowledge Base, Windows | Skriv en kommentar