Yesterday the buttons in one of our Excel 2010 files stopped working. Solved after reading this:
https://social.technet.microsoft.com/Forums/office/en-US/b8f0af82-0bb8-4799-aa62-1dbcbc5b7742/excel-2010-macros-does-not-work-after-updates-9dec2014?forum=excel
Thursday, December 11, 2014
Monday, December 1, 2014
Sending Mail in Perl
Using MIME::Lite module
You could write your own email client using MIME:Lite perl module. You can download this module from MIME-Lite-3.01.tar.gz and install it on your either machine Windows or Linux/Unix. To install it follow the following simple steps:
$tar xvfz MIME-Lite-3.01.tar.gz $cd MIME-Lite-3.01 $perl Makefile.PL $make $make install
That's it and you will have MIME::Lite module installed on your machine. Now you are ready to send your email with simple scripts explained below.
SENDING A PLAIN MESSAGE
Now following is a script which will take care of sending email to the given email ID:
#!/usr/bin/perl use MIME::Lite; $to = 'abcd@gmail.com'; $cc = 'efgh@mail.com'; $from = 'webmaster@yourdomain.com'; $subject = 'Test Email'; $message = 'This is test email sent by Perl Script'; $msg = MIME::Lite->new( From => $from, To => $to, Cc => $cc, Subject => $subject, Data => $message ); $msg->send; print "Email Sent Successfully\n";
SENDING AN HTML MESSAGE
If you want to send HTML formatted email using sendmail then you simply need to add Content-type: text/html\n in the header part of the email. Following is the script which will take care of sending HTML formatted email:
#!/usr/bin/perl use MIME::Lite; $to = 'abcd@gmail.com'; $cc = 'efgh@mail.com'; $from = 'webmaster@yourdomain.com'; $subject = 'Test Email'; $message = '<h1>This is test email sent by Perl Script</h1>'; $msg = MIME::Lite->new( From => $from, To => $to, Cc => $cc, Subject => $subject, Data => $message ); $msg->attr("content-type" => "text/html"); $msg->send; print "Email Sent Successfully\n";
SENDING AN ATTACHEMENT
If you want to send an attachement then following script serve the purpose:
#!/usr/bin/perl use MIME::Lite; $to = 'abcd@gmail.com'; $cc = 'efgh@mail.com'; $from = 'webmaster@yourdomain.com'; $subject = 'Test Email'; $message = 'This is test email sent by Perl Script'; $msg = MIME::Lite->new( From => $from, To => $to, Cc => $cc, Subject => $subject, Type => 'multipart/mixed' ); # Add your text message. $msg->attach(Type => 'text', Data => $message ); # Specify your file as attachement. $msg->attach(Type => 'image/gif', Path => '/tmp/logo.gif', Filename => 'logo.gif', Disposition => 'attachment' ); $msg->send; print "Email Sent Successfully\n";
You can attache as many as files you like in your email using attach() method.
Using SMTP Server
If your machine is not running an email server then you can use any other email server available at remote location. But to use any other email server you will need to have an id, its password, URL etc. Once you have all the required information, you simple need to provide that information in send()method as follows:
$msg->send('smtp', "smtp.myisp.net", AuthUser=>"id", AuthPass=>"password" );
You can contact your email server administrator to have above used information and if a user id and password is not already available then your administrator can create it in minutes.
Wednesday, November 26, 2014
Thursday, November 13, 2014
Isolating CPUs from the general scheduler in Linux.
It could be done using the kernel parameters:
isolcpus=
Format:
<cpu number>,...,<cpu number>
or
<cpu number>-<cpu number>
(must be a positive range in ascending order) or a mixture
<cpu number>,...,<cpu number>-<cpu number>
This option can be used to specify one or more CPUs to isolate from the general SMP balancing and scheduling algorithms. You can move a process onto or off an "isolated" CPU via the CPU affinity syscalls or cpuset.
<cpu number> begins at 0 and the maximum value is "number of CPUs in system - 1".
This option is the preferred way to isolate CPUs. The alternative -- manually setting the CPU mask of all tasks in the system -- can cause problems and suboptimal load balancer performance.
Taken from /usr/share/doc/kernel-doc-2.6.32/Documentation/kernel-parameters.txt
isolcpus=
Format:
<cpu number>,...,<cpu number>
or
<cpu number>-<cpu number>
(must be a positive range in ascending order) or a mixture
<cpu number>,...,<cpu number>-<cpu number>
This option can be used to specify one or more CPUs to isolate from the general SMP balancing and scheduling algorithms. You can move a process onto or off an "isolated" CPU via the CPU affinity syscalls or cpuset.
<cpu number> begins at 0 and the maximum value is "number of CPUs in system - 1".
This option is the preferred way to isolate CPUs. The alternative -- manually setting the CPU mask of all tasks in the system -- can cause problems and suboptimal load balancer performance.
Taken from /usr/share/doc/kernel-doc-2.6.32/Documentation/kernel-parameters.txt
Boot parameters of the running kernel in Linux
Let's say I need to find out with what parameters did the kernel boot?
The following command will give you the answer:
cat /proc/cmdline
For example:
janeiros@harlie:~$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.0.0-32-generic-pae root=/dev/mapper/harlie-root ro quiet
The following command will give you the answer:
cat /proc/cmdline
For example:
janeiros@harlie:~$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.0.0-32-generic-pae root=/dev/mapper/harlie-root ro quiet
Tuesday, October 28, 2014
Endianness mnemotechnic
In Big Endian, you store the most significant byte in the smallest address. In Little Endian, you store the least significant byte in the smallest address.
http://en.wikipedia.org/wiki/Endianness
Monday, October 27, 2014
Guava Files class
Saturday, October 11, 2014
Foundation and Empire
- Part I: The General
- Search for Magicians
- The Magicians
- The Dead Hand
- The Emperor
- The War Begins
- The Favorite
- Bribery
- To Trantor
- On Trantor
- The War Ends
- Part II The Mule
- Bride and Groom
- Captain and Mayor
- Lieutenant and Clown
- The Mutant
- The Psychologist
- Conference
- The Visi-Sonor
- Fall of the Foundation
- Start of the Search
- Conspirator
- Interlude in Space
- Death on Neotrantor
- The Ruins of Trantor
- Convert
- Death of a Psychologist
- End of the Search
Labels:
Asimov,
Foundation and Empire,
Foundation series
Friday, October 3, 2014
IPTABLES
# List the rules with line numbers,
# the -n disables the DNS reverse lookup
iptables -n --list --line-numbers
# Block a specific IP
iptables -A INPUT -s 192.168.0.1 -j DROP
# Allow SSH for a specific IP
iptables -A INPUT -s 192.168.0.2 -p tcp -m tcp --dport 22 -j ACCEPT
# Delete a rule based on its number
iptables -D INPUT 8
# Insert rule before other certain one
# For example before line # 3
iptables -I INPUT 3 -s 192.168.0.2 -p tcp -m tcp --dport 22 -j ACCEPT
# the -n disables the DNS reverse lookup
iptables -n --list --line-numbers
# Block a specific IP
iptables -A INPUT -s 192.168.0.1 -j DROP
# Allow SSH for a specific IP
iptables -A INPUT -s 192.168.0.2 -p tcp -m tcp --dport 22 -j ACCEPT
# Delete a rule based on its number
iptables -D INPUT 8
# Insert rule before other certain one
# For example before line # 3
iptables -I INPUT 3 -s 192.168.0.2 -p tcp -m tcp --dport 22 -j ACCEPT
Thursday, September 25, 2014
Java 8 installation on Fedora 14
- Download Java SDK/JRE from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html. (I selected the server version).
- Extract the files into /usr/local/java. (I created the java directory).
- Use the alternatives program to create the necessary links:
- [root@Fedora-test ~]# alternatives --install /usr/bin/java java /usr/local/java/jdk1.8.0_20/bin/java 20000
- Run the alternatives config command:
[root@Fedora-test ~]# alternatives --config java
Select the option for Java 8
- Test it:
[root@Fedora-test ~]# java -versionThe following link was useful: http://www.dafoot.co.uk/index.php/menuitemcomputing/linux/101-fedora-12-alternatives-program-to-manage-java-runtimes-jdkjre
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
Tuesday, September 23, 2014
Thursday, September 11, 2014
Dumping computer’s DMI (SMBIOS) in Linux
dmidecode
dmidecode -t
The SMBIOS specification defines the following DMI types:
Type Information
--------------------------------------------
0 BIOS
1 System
2 Baseboard
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Devices Extended Information
42 Management Controller Host Interface
dmidecode -t
The SMBIOS specification defines the following DMI types:
Type Information
--------------------------------------------
0 BIOS
1 System
2 Baseboard
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Devices Extended Information
42 Management Controller Host Interface
Additionally, type 126 is used for disabled entries and type 127 is an end-of-table marker. Types 128 to 255 are for OEM-specific data.
Keywords can be used instead of type numbers with --type. Each keyword is equivalent to a list of type numbers:
Keyword Types
------------------------------
bios 0, 13
system 1, 12, 15, 23, 32
baseboard 2, 10, 41
chassis 3
processor 4
memory 5, 6, 16, 17
cache 7
connector 8
slot 9
Wednesday, August 13, 2014
Excel Regular Expressions
Sub RegEx_Tester()
Dim objRegExp_1 As Object
Dim regExp_Matches As Object
Dim strToSearch As String
Set objRegExp_1 = CreateObject("vbscript.regexp")
objRegExp_1.Global = True
objRegExp_1.IgnoreCase = True
objRegExp_1.Pattern = "[a-z,A-Z]*@[a-z,A-Z]*.com"
strToSearch = "ABC@xyz.com"
Set regExp_Matches = objRegExp_1.Execute(strToSearch)
If regExp_Matches.Count = 1 Then
MsgBox ("This string is a valid email address.")
End If
End Sub
Dim objRegExp_1 As Object
Dim regExp_Matches As Object
Dim strToSearch As String
Set objRegExp_1 = CreateObject("vbscript.regexp")
objRegExp_1.Global = True
objRegExp_1.IgnoreCase = True
objRegExp_1.Pattern = "[a-z,A-Z]*@[a-z,A-Z]*.com"
strToSearch = "ABC@xyz.com"
Set regExp_Matches = objRegExp_1.Execute(strToSearch)
If regExp_Matches.Count = 1 Then
MsgBox ("This string is a valid email address.")
End If
End Sub
Thursday, July 10, 2014
flock - Manage locks from shell scripts
Only one running instance of a script:
flock -n /var/lock/lock_file.lock script.sh
flock -n /var/lock/lock_file.lock script.sh
Thursday, May 29, 2014
SYMPATHY
I know what the caged bird feels, alas!
When the sun is bright on the upland slopes;
When the wind stirs soft through the springing grass,
And the river flows like a stream of glass;
When the first bird sings and the first bud opes,
And the faint perfume from its chalice steals—
I know what the caged bird feels!
I know why the caged bird beats his wing
Till its blood is red on the cruel bars;
For he must fly back to his perch and cling
When he fain would be on the bough a-swing;
And a pain still throbs in the old, old scars
And they pulse again with a keener sting—
I know why he beats his wing!
I know why the caged bird sings, ah me,
When his wing is bruised and his bosom sore,—
When he beats his bars and he would be free;
It is not a carol of joy or glee,
But a prayer that he sends from his heart's deep core,
But a plea, that upward to Heaven he flings—
I know why the caged bird sings!
Paul Laurence Dunbar
http://www.gutenberg.org/files/18338/18338-h/18338-h.htm#Page_102
When the sun is bright on the upland slopes;
When the wind stirs soft through the springing grass,
And the river flows like a stream of glass;
When the first bird sings and the first bud opes,
And the faint perfume from its chalice steals—
I know what the caged bird feels!
I know why the caged bird beats his wing
Till its blood is red on the cruel bars;
For he must fly back to his perch and cling
When he fain would be on the bough a-swing;
And a pain still throbs in the old, old scars
And they pulse again with a keener sting—
I know why he beats his wing!
I know why the caged bird sings, ah me,
When his wing is bruised and his bosom sore,—
When he beats his bars and he would be free;
It is not a carol of joy or glee,
But a prayer that he sends from his heart's deep core,
But a plea, that upward to Heaven he flings—
I know why the caged bird sings!
Paul Laurence Dunbar
http://www.gutenberg.org/files/18338/18338-h/18338-h.htm#Page_102
Wednesday, April 30, 2014
systemd-analyze - Analyze system boot-up performance
systemd-analyze may be used to determine system boot-up performance of the current boot.
systemd-analyze blame prints a list of all running units, ordered by the time they took to initialize.
systemd-analyze blame prints a list of all running units, ordered by the time they took to initialize.
Wednesday, April 2, 2014
Wednesday, January 15, 2014
Fedora Full List of Kernel Options
The full list of kernel options is in the file /usr/share/doc/kernel-doc-<version>/Documentation/kernel-parameters.txt, which is installed with the kernel-doc package.
Taken from:
https://fedoraproject.org/wiki/Common_kernel_problems#Getting_the_Full_List_of_Kernel_Options
Taken from:
https://fedoraproject.org/wiki/Common_kernel_problems#Getting_the_Full_List_of_Kernel_Options
Thursday, January 2, 2014
2014 Federal Holidays
Date | Holiday |
---|---|
Wednesday, January 1 | New Year’s Day |
Monday, January 20 | Birthday of Martin Luther King, Jr. |
Monday, February 17 * | Washington’s Birthday |
Monday, May 26 | Memorial Day |
Friday, July 4 | Independence Day |
Monday, September 1 | Labor Day |
Monday, October 13 | Columbus Day |
Tuesday, November 11 | Veterans Day |
Thursday, November 27 | Thanksgiving Day |
Thursday, December 25 | Christmas Day |
*This holiday is designated as "Washington’s Birthday" in section 6103(a) of title 5 of the United States Code, which is the law that specifies holidays for Federal employees. Though other institutions such as state and local governments and private businesses may use other names, it is our policy to always refer to holidays by the names designated in the law.
Subscribe to:
Posts (Atom)