Skip to content

Instantly share code, notes, and snippets.

diff --git a/chipdrivers.h b/chipdrivers.h
index 851e90a..3f31293 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -52,6 +52,7 @@ int spi_block_erase_c4(struct flashctx *flash, unsigned int addr, unsigned int b
int spi_block_erase_c7(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
int spi_block_erase_d7(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
int spi_block_erase_d8(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
+int spi_block_erase_dc(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
int spi_block_erase_db(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
@devicenull
devicenull / gist:8720643
Last active August 29, 2015 13:55
Flashrom MX25L25635F chip defintiion
diff --git a/flashchips.c b/flashchips.c
index a6db11e..ac3ef53 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -5907,6 +5907,33 @@ const struct flashchip flashchips[] = {
.voltage = {3000, 3600},
},
+ {
+ .vendor = "Macronix",
# hexdump -C test
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
10000000
diff --git a/spi.c b/spi.c
index 94a76a7..b5c4bde 100644
--- a/spi.c
+++ b/spi.c
@@ -104,18 +104,18 @@ int default_spi_write_256(struct flashctx *flash, uint8_t *buf,
int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start,
unsigned int len)
{
- unsigned int addrbase = 0;
+ unsigned long long addrbase = 0;
2014-05-27 23:51:28.067489 7f7eda9b9700 -1 msg/Pipe.cc: In function 'int Pipe::connect()' thread 7f7eda9b9700 time 2014-05-27 23:51:27.526399
msg/Pipe.cc: 1070: FAILED assert(m)
ceph version 0.80.1 (a38fe1169b6d2ac98b427334c12d7cf81f809b74)
1: (Pipe::connect()+0x3d0c) [0xb2931c]
2: (Pipe::writer()+0x9f3) [0xb2a063]
3: (Pipe::Writer::entry()+0xd) [0xb359cd]
4: /lib64/libpthread.so.0() [0x37cb2079d1]
5: (clone()+0x6d) [0x37caae8b7d]
NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.
root@localhost ~ # coreos-cloudinit --from-ec2-metadata="http://169.254.169.254"
Checking availability of "ec2-metadata-service"
Fetching user-data from datasource of type "ec2-metadata-service"
2014/09/12 18:50:18 Fetching data from http://169.254.169.254/2009-04-04/user-data. Attempt #1
Fetching meta-data from datasource of type "ec2-metadata-service"
2014/09/12 18:50:18 Fetching data from http://169.254.169.254/2009-04-04/meta-data/public-keys. Attempt #1
2014/09/12 18:50:18 Fetching data from http://169.254.169.254/2009-04-04/meta-data/hostname. Attempt #1
2014/09/12 18:50:18 Fetching data from http://169.254.169.254/2009-04-04/meta-data/local-ipv4. Attempt #1
2014/09/12 18:50:18 Fetching data from http://169.254.169.254/2009-04-04/meta-data/public-ipv4. Attempt #1
2014/09/12 18:50:18 Fetching data from http://169.254.169.254/2009-04-04/meta-data/network_config/content_path. Attempt #1
#
# Background: this was done on a CentOS 6.5 ESXi VM running pmacct 1.5.0rc2 and PostgreSQL 9.3 from PGDG repo with
# the following config line for pmacct:
#
# ./configure --enable-pgsql --enable-geoip --enable-ipv6 --with-pgsql-libs=/usr/pgsql-9.3/lib --with-pgsql-includes=/usr/pgsql-9.3/include
#
#
# I also customized the table they used in postgres to add vertical partitioning, but that's another gist :)
#
# Get msr-tools from https://www.kernel.org/pub/linux/utils/cpu/msr-tools/
Run:
./rdmsr -d -f 15:8 0x199 -> (IA32_PERF_CTL) This gives you the p-state that the OS is requesting
./rdmsr -d -f 15:8 0x198 -> (IA32_PERF_STATUS) This gives you the p-state that the processor is delivering
cron { 'pingscanner':
command => 'checkping'
,user => nobody
,hour => '*'
,minute => [3,8,13,18,23,28,33,38,43,48,53,58]
}
@devicenull
devicenull / raidcontroller.rb
Created May 18, 2012 00:48
raidcontroller.rb
Facter.add("raidcontroller") do
confine :kernel => :linux
ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin"
setcode do
controllers = []
lspciexists = system "/bin/bash -c 'which lspci >&/dev//null'"
if $?.exitstatus == 0
output = %x{lspci}
output.each {|s|
controllers.push("megaraid") if s =~ /RAID bus controller: .* MegaRAID .*/