Thanks to Joshua Fernandes’ Robin_Stocks python module, you can download all your stock orders from RobinHood easily to a CSV file in order to calculate gains and losses to help when doing your taxes.

Below is a quick guide for how to do it in Linux, buy you can probably do it just as easily in Windows or on a Mac!

#First, install the module
$ sudo pip install robin_stocks

#Next, create a file to contain your user credentials, here’s an example
$ cat config.json
{
“username”: “usernamehere”,
“password”: “passw0rdh3r3”
}

#Don’t worry, Robin_Stocks is smart enough to ask for your MFA code if you are using that feature

#Here’s the simple python program to make a CSV file and save it to your computer

$ cat download_stock_orders.py
import json
import robin_stocks as rh


content = open(‘config.json’).read()
config = json.loads(content)
rh.login(config[‘username’], config[‘password’])
rh.export_completed_stock_orders(“.”)

#Run it like this:
$ python3 download_stock_orders.py
Found Additional pages.
Loading page 2 …
Loading page 3 …
Loading page 4 …

#And here’s the resulting file dated with today’s date!
$ ls *.csv
stock_orders_Jan-08-2021.csv

#Here’s what it looks like!
$ head stock_orders_Jan-08-2021.csv
symbol,date,order_type,side,fees,quantity,average_price
VNE,2021-01-07T17:42:58.730000Z,limit,buy,0.00,2.00000000,20.55000000
KBNT,2021-01-07T14:30:10.837000Z,market,sell,0.00,10.00000000,5.44000000
BNGO,2021-01-06T19:26:02.112000Z,limit,buy,0.00,12.00000000,5.05500000
PLTR,2021-01-04T14:37:28.082000Z,limit,buy,0.00,9.00000000,22.55000000
PLTR,2020-12-31T16:33:27.710000Z,market,sell,0.00,9.00000000,23.87110000
VSTO,2020-12-31T14:33:02.565000Z,limit,buy,0.00,5.00000000,23.98000000
FUBO,2021-01-04T14:36:31.806000Z,limit,buy,0.00,4.00000000,27.00000000
FUBO,2020-12-28T14:19:39.850000Z,limit,sell,0.00,3.00000000,40.46000000
UUUU,2020-12-29T14:59:36.264000Z,limit,buy,0.00,3.00000000,4.15000000

After this I simply loaded it into a spreadsheet and was able to sort and easily calculate gains and losses!

As of November 23, 2020 here’s a list of the currently tradeable Pink Sheet OTC stocks (ADF type securities) on RobinHood:

symbolnametradeablecountrylist_datesecurity typerhs_tradability
AACAYAAC Technologies Holdings Inc Unsponsored ADR (Cayman Islands)TrueCN2009-02-12adrtradable
AAGIYAIA Group, Ltd. Sponsored American Depository Receipt (Hong Kong)TrueHK2011-06-23adrtradable
ACGBYAgricultural Bank of China Unsponsored American Depository Receipt (China)TrueCN2011-01-24adrtradable
ACSAYACS Actividades De Construccion Y Servicios SA Unsponsored ADR (Spain)TrueES2014-05-20adrtradable
AGESYAgeas Sponsored ADR (Belgium)TrueBE2012-08-07adrtradable
AHEXYAdecco Group AG American Depositary Receipts – UnsponsoredTrueCH2008-12-30adrtradable
AMADYAmadeus IT Group SA American Depositary Receipts – UnsponsoredTrueES2011-06-06adrtradable
AMKBYA.P. Moller-Maersk A/S Unsponsored American Depository Receipt (Denmark)TrueDK2012-02-16adrtradable
ANZBYAustralia and New Zealand Banking Group Limited Common StockTrueAU2007-07-12adrtradable
APELYAlps Alpine Co., Ltd. American Depositary Receipts – UnsponsoredTrueJP2003-06-05adrtradable
ASGLYAGC Inc. American Depositary Receipts – UnsponsoredTrueJP2018-07-02adrtradable
ASOMYASOS Plc Unsponsored ADR (United Kingdom)TrueGB2010-06-01adrtradable
AVVIYAviva PLC ADRs – Unsponsored (United Kingdom)TrueGB2009-10-20adrtradable
BACHYBank of China Ltd Beijing Unsponsored ADR representing H shares (China)TrueCN2009-04-24adrtradable
BAESYBAE SYSTEMS plc Sponsored ADRTrueGB2000-05-08adrtradable
BAYRYBayer Aktiengesellschaft American Depositary Shares (Each repstg one Bayer AG ordinary share of no par value)TrueDE2007-09-27adrtradable
BCAUYBrilliance China Automotive Holdings Limited Unsponsored ADR (Bermuda)TrueHK2011-06-21adrtradable
BDORYBanco Do Brasil SA Sponsored ADRTrueBR2009-12-03adrtradable
BKRKYBank Rakyat Indonesia Unsponsored ADR Rep Shs B (Indonesia)TrueID2009-05-28adrtradable
BMWYYBayerische Motoren Werke Ag Pf American Depositary Receipts – Sponsored (Germany)TrueDE2016-07-01adrtradable
BNTGYBrenntag AG, Muehleim/Ruhr Unsponsored American Depository Receipt (Germany)TrueDE2012-12-21adrtradable
BRDCYBridgestone Corp Ord (Unsponsored) American Depositary SharesTrueJP2000-07-27adrtradable
BTLCYBritish Land Co Sponsored ADR (UK)TrueGB2003-11-18adrtradable
BURBYBurberry Group Plc Sponsored ADRTrueGB2009-09-04adrtradable
BXBLYBrambles Ltd Sponsored ADR (Australia)TrueAU2015-06-16adrtradable
BYDDYBYD Company Ltd Unsponsored ADR representing H Shares (China)TrueCN2008-10-20adrtradable
BZLFYBunzl Plc American Depositary SharesTrueGB2007-06-06adrtradable
CABGYCarlsberg AS Sponsored ADR Representing Class B Shares (Denmark)TrueDK2010-03-01adrtradable
CCOJYCoca-Cola Bottlers Japan Holdings Inc American Depositary Receipts – UnsponsoredTrueJP2010-08-12adrtradable
CFRUYCompagnie Financiere Richemont Unsponsored ADR (Switzerland)TrueCH2009-01-12adrtradable
CHYHYCHR Hansen Hldg A/S SPONSORED ADR (Denmark)TrueDK2014-01-29adrtradable
CICHYChina Construction Bank Corporation Unsponsored ADR representing H shares (China)TrueCN2009-02-12adrtradable
CIHKYChina Merchants Bank Co Ltd American Depository Receipt (Unsponsored)TrueCN2010-09-23adrtradable
CJPRYCentral Japan Railway Co Unsponsored ADR (Japan)TrueJP2007-02-26adrtradable
CKHUYCK Hutchison Holdings LTD American Depositary Receipts – UnsponsoredTrueHK2015-04-13adrtradable
CLLDYCapitaland Ltd Sponsored American Depositary SharesTrueSG2004-02-18adrtradable
CLPBYColoplast AS American Depositary Receipts – SponsoredTrueDK2014-01-13adrtradable
CLPHYCLP Holdings Ltd Sponsored ADRTrueHK2000-02-22adrtradable
CMPGYCompass Group Plc American Depositary Receipts – SponsoredTrueGB2017-06-27adrtradable
CMWAYCommonwealth Bank Of Australia Sponsored ADR (Australia)TrueAU2009-09-15adrtradable
COIHYCroda Intl Plc Ord American Depositary Receipts – UnsponsoredTrueGB2011-08-15adrtradable
COVTYCovestro AG ADR – Sponsored (Germany)TrueDE2016-12-14adrtradable
CPYYYCentrica plc Sponsored American Depositary SharesTrueGB2004-10-25adrtradable
CRZBYCommerzbank Junge Shs American Depositary SharesTrueDE2013-04-25adrtradable
CSLLYCsl Ltd SPONSORED ADR (Australia)TrueAU2014-06-09adrtradable
CSUAYChina Shenhua Energy Co Ltd Unsponsored ADR representing A shs (China)TrueCN2009-09-02adrtradable
CTTAYContl Ag Ord American Depositary SharesTrueDE2000-02-22adrtradable
CZMWYCarl Zeiss Meditec AG Unsponsored ADR (Germany)TrueDE2010-06-11adrtradable
DBOEYDeutsche Boerse Ag Unsponsored ADR (Germany)TrueDE2008-10-30adrtradable
DBSDYDbs Group Holdings Ltd Ord American Depositary SharesTrueSG2000-02-22adrtradable
DCMYYNTT DOCOMO, Inc. American Depositary Receipts – Sponsored (Japan)TrueJP2002-03-01adrtradable
DIFTYDaito Trust Construction Co Lt Sponsored ADR (Japan)TrueJP2013-12-23adrtradable
DKILYDaikin Inds Ltd Unsponsored ADR (Japan)TrueJP2010-02-11adrtradable
DMLRYDaimler AG American Depositary Receipts – Unsponsored (Germany)TrueDE2017-01-06adrtradable
DNHBYDNB ASA SPONSORED ADR Representing 10 (Norway)TrueNO2010-09-08adrtradable
DNKEYDanske Bank A\/S Bearer Shs Ord American Depositary Receipts – Sponsored (Denmark)TrueDK2016-02-09adrtradable
DNZOYDenso Corp Ltd Ord American Depositary SharesTrueJP2002-01-30adrtradable
DPSGYDeutsche Post AG Sponsored ADR (Germany)TrueDE2009-12-08adrtradable
DQJCYPan Pac Intl Hldgs Corp American Depositary Receipts – UnsponsoredTrueJP2010-11-24adrtradable
DSDVYDSV Panalpina A/S American Depositary Receipts – UnsponsoredTrueDK2013-09-04adrtradable
DSEEYDaiwa Securities Group Inc Japan Ord Sponsored ADR (Japan)TrueJP2010-01-29adrtradable
DSNKYDaiichi Sankyo Co Limited Sponsored ADR (Japan)TrueJP2011-11-15adrtradable
DWAHYDaiwa House Ind Ltd American Depositary SharesTrueJP2003-01-14adrtradable
EADSYAirbus SE American Depositary Receipts – UnsponsoredTrueNL2014-01-02adrtradable
EBKDYErste Group Bank AG Sponsored ADR (Austria)TrueAT2003-12-16adrtradable
EJPRYEast Japan Railway Co Unsponsored ADR (Japan)TrueJP2008-05-29adrtradable
EONGYE.ON SE Sponsored ADR (Germany)TrueDE2007-09-10adrtradable
ESALYEisai Co Ltd American Depositary SharesTrueJP2000-02-22adrtradable
FANUYFanuc Corporation Unsponsored ADR (Japan)TrueJP2008-11-04adrtradable
FJTSYFujitsu Ltd ADRTrueJP2000-02-22adrtradable
FRRVYFerrovial SA Unsponsored ADR (Spain)TrueES2010-06-07adrtradable
FUJHYSubaru Corporation American Depositary Receipts – UnsponsoredTrueJP2017-04-03adrtradable
FUJIYFUJIFILM Holdings Corporation American Depositary SharesTrueJP1994-01-03adrtradable
FUPBYFuchs Petrolub SE Unsponsored American Depository ReceiptRepresenting Preferenced Shares (Germany)TrueDE2014-02-27adrtradable
GELYYGeely Automobile Holding Ltd Unsponsored ADR (Cayman Islands)TrueHK2009-11-09adrtradable
GLNCYGLENCORE PLC American Depositary Receipts – UnsponsoredTrueCH2013-05-16adrtradable
GLPEYGalp Energia, SA, Lisboa Unsponsored ADR representing -B-Shares (Portugal)TrueUS2011-05-11adrtradable
GVDNYGivaudan SA Unsponsored ADR (Switzerland)TrueCH2008-12-11adrtradable
HCMLYLafargeHolcim Ltd. American Depositary Receipts – UnsponsoredTrueCH2009-02-09adrtradable
HDELYHeidelbergCement Ag Unsponsored ADR (Germany)TrueDE2010-11-08adrtradable
HENOYHenkel AG and Co. KGAA Sponsored ADR representing Preferred Shares (Germany)TrueDE2004-06-30adrtradable
HGKGYPower Assets Holdings Ltd American Depositary SharesTrueHK2000-02-22adrtradable
HKXCYHong Kong Exchanges & Clearing Ltd Unsponsored ADR (Hong Kong)TrueHK2008-11-20adrtradable
HOCPYHoya Corp Sponsored ADR (Japan)TrueJP2004-10-01adrtradable
HTHIYHitachi, Ltd. American Depositary SharesTrueJP2012-04-27adrtradable
HVRRYHannover Rueckversicherung SE American Depositary SharesTrueDE2005-01-04adrtradable
HYPMYHypera SA American Depositary Receipts – SponsoredTrueBR2018-03-06adrtradable
ICAGYInternational Consolidated Airlines Group SA Sponsored American Depository Receipt (Spain)TrueGB2011-01-26adrtradable
IDCBYIndustrial & Commercial Bank of China Ltd representing H shares Unsponsored ADR (China)TrueCN2009-03-17adrtradable
IFJPYInforma PLC Sponsored ADR (Jersey)TrueGB2013-07-02adrtradable
INVVYINDIVIOR PLC American Depositary Receipts – SponsoredTrueGB2014-12-30adrtradable
ISNPYIntesa Sanpaolo S.P.A. Sponsored ADR (Italy)TrueIT2007-01-05adrposition_closing_only
ITOCYItochu Corp American Depositary SharesTrueJP2004-11-17adrtradable
ITVPYITV plc Unsponsored ADR (UK)TrueGB2009-10-05adrtradable
JAPAYJapan Tobacco Unsponsored American Depository Receipt ( Japan)TrueJP2014-10-03adrtradable
JMHLYJardine Matheson Holdings Ltd Unsponsored ADRTrueHK2004-06-15adrtradable
JPXGYJapan Exchange Group, Inc. Unsponsored ADR (Japan)TrueJP2015-05-13adrtradable
JSHLYJardine Strategic Holdings Ltd Bermuda Unsponsored ADRTrueBM2004-06-15adrtradable
KAOOYKao Corporation ADR Repstg 1/5 Com – Unsponsored (Japan)TrueJP2018-05-03adrtradable
KBCSYKBC Group NV Unsponsored ADR (Belgium)TrueBE2011-09-23adrtradable
KCDMYKimberly-Clark De Mexico S A B de C V Sponsored ADR (Mexico)TrueMX2000-02-22adrtradable
KDDIYKDDI Corporation Unsponsored ADR (Japan)TrueJP2008-12-18adrtradable
KMTUYKomatsu Ltd Ord American Depositary SharesTrueJP2000-02-22adrtradable
KNBWYKirin Holdings Company, Limited Sponsored ADR (Japan)TrueJP1994-01-03adrtradable
KNYJYKone Oyj Unsponsored ADR representing B shares (Finland)TrueFI2011-08-31adrtradable
KPCPYKasikornbank Public Co Ltd Unsponsored ADR (Thailand)TrueTH2011-08-01adrtradable
KYOCYKyocera Corp American Depositary Receipts – Sponsored (Japan)TrueJP1990-01-02adrtradable
KZMYYKaz Minerals Plc American Depositary Receipts – UnsponsoredTrueGB2010-05-05adrtradable
LLESYLendlease Corporation Limited American Depositary Receipts – SponsoredTrueAU2002-07-29adrtradable
LNSTYLONDON STK EXCHANGE GROUP American Depositary Receipts – Unsponsored (United Kingdom)TrueGB2015-11-05adrtradable
LUKOYPJSC Lukoil American Depositary Receipts – SponsoredTrueRU2015-10-20adrtradable
LZAGYLonza Group Ag Zuerich Unsponsored ADR (Switzerland)TrueCH2008-10-16adrtradable
MAURYMarui Group Co Ltd ADR (Japan)TrueJP2003-06-05adrtradable
MDIBYMediobanca – Banca Di Credito Finanziario SPA Unsponsored ADR (Italy)TrueIT2011-12-08adrposition_closing_only
MHGVYMowi ASA American Depositary Receipts – SponsoredTrueNO2008-04-07adrtradable
MIELYMitsubishi Electric Corp ADRTrueJP2002-07-18adrtradable
MITEYMitsubishi Estate Co Ltd American Depositary SharesTrueJP2001-12-07adrtradable
MITSYMitsui & Company, Ltd. American Depositary SharesTrueJP1994-01-03adrtradable
MKTAYMakita Corp. American Depositary SharesTrueJP1990-03-27adrtradable
MONOYMonotaro Co. Ltd., Osaka Unsponsored ADR (Japan)TrueJP2013-11-14adrtradable
MQBKYMacquarie Group, Ltd. Sponsored ADR (Australia)TrueAU2014-01-27adrtradable
MRAAYMurata Manufacturing Co Ltd Unsponsored ADR (Japan)TrueJP2009-04-13adrtradable
MRWSYWM Morrison Supermarkets Plc Unsponsored ADR (UK)TrueGB2008-10-28adrtradable
MSADYMS&AD Insurance Group Holdings, Inc. Unsponsored ADR (Japan)TrueJP2010-04-01adrtradable
MTNOYMTN Group, Ltd. Sponsored American Depositary ReceiptTrueZA2003-08-13adrtradable
MURGYMuenchener Re Group AG Unsponsored ADR (Germany)TrueDE2008-10-17adrtradable
MZDAYMazda Motor Corp Unsponsored ADR (Japan)TrueJP2009-10-05adrtradable
NABZYNational Australia Bank Limited Common StockTrueAU2007-06-18adrtradable
NCMGYNewcrest Mining Ltd Sponsored American Depositary SharesTrueAU2002-01-02adrtradable
NDEKYNitto Denko Corporation American Depositary SharesTrueJP2003-10-31adrtradable
NILSYMMC Norilsk Nickel PJSC American Depositary Receipts – SponsoredTrueRU2015-09-22adrtradable
NJDCYNidec Corporation American Depositary Receipts – SponsoredTrueJP2010-07-01adrtradable
NNGRYNN Group NV American Depositary Receipts – Unsponsored (Netherlands)TrueNL2017-06-02adrtradable
NPSNYNaspers Limited American Depositary Receipts – SponsoredTrueZA2017-08-11adrtradable
NSANYNissan Motor Co., Ltd. American Depositary SharesTrueJP1994-03-17adrtradable
NSRGYNestle SA Sponsored ADR representing Registered Shares Series B (Switzerland)TrueCH2000-02-22adrtradable
NTDOYNintendo Co Ltd ADRTrueJP2000-02-22adrtradable
NTTYYNippon Telegraph and Telephone Corporation American Depositary Shares – SponsoredTrueJP1994-09-29adrtradable
NVZMYNovozymes A/S Unsponsored American Depositary ReceiptTrueDK2005-10-03adrtradable
OCPNYOlympus Corporation Sponsored ADR (Japan)TrueJP2003-11-18adrtradable
OGZPYPJSC Gazprom American Depositary Receipts – SponsoredTrueRU2006-04-18adrtradable
OISHYOil Search Ltd Sponsored ADRTrueAU2003-11-12adrtradable
OMRNYOmron Corporation Sponsored American Depositary SharesTrueJP2003-09-05adrtradable
ORKLYOrkla AS Sponsored American Depositary SharesTrueNO2003-11-26adrtradable
OTSKYOtsuka Holdings Co. Ltd, Tokyo Unsponsored ADR (Japan)TrueJP2012-08-02adrtradable
OVCHYOversea-Chinese Banking Corporation Ltd Unsponsored ADR (Singapore)TrueSG2011-05-10adrtradable
PBSFYProSiebenSat.1 Media SE American Depositary Receipts – UnsponsoredTrueDE2012-02-29adrtradable
PCRFYPanasonic Corporation Common StockTrueJP2008-10-01adrtradable
PDYPYFlutter Entmt Plc American Depositary Receipts – UnsponsoredTrueIE2015-07-30adrtradable
PNGAYPing An Insurance (Group) Company of China Ltd Sponsored ADR (China)TrueCN2007-07-18adrtradable
POAHYPorsche Automobile Holding SE Unsponsored ADR (Germany)TrueDE2009-03-16adrtradable
PPERYPT Bank Mandiri Persero TBK Unsponsored ADR (Indonesia)TrueID2009-08-14adrtradable
PSMMYPersimmon Plc Unsponsored ADR (UK)TrueGB2013-08-15adrtradable
QBIEYQBE Insurance Group Ltd Sponsored American Depository Receipt (Australia)TrueAU2011-03-14adrtradable
RBGLYReckitt Benckiser Plc Sponsored ADRTrueGB2012-12-21adrtradable
RDEIYRed Electrica Corporacion SA Unsponsored ADR (Spain)TrueES2008-11-10adrtradable
RKUNYRakuten Inc Sponsored ADR (Japan)TrueJP2013-12-26adrtradable
ROYMYRoyal Mail PLC Unsponsored ADR (United Kingdom)TrueGB2014-05-06adrtradable
RTMVYRightmove Plc Unsponsored ADR (United Kingdom)TrueGB2012-10-09adrtradable
RTOKYRentokil Initial Plc (Fgn) American Depositary SharesTrueGB2000-02-22adrtradable
RWEOYRwe Ag Ord Bearer Dm5 American Depository ReceiptTrueDE2000-02-22adrtradable
RYCEYRolls Royce Holdings plc Sponsored American Depositary SharesTrueGB2000-02-22adrtradable
RYKKYRyohin Keikaku Co Ltd (Jpn) Unsponsored ADR (Japan)TrueJP2014-04-25adrtradable
SAXPYSampo OYJ Unsponsored ADR representing A shares (Finland)TrueFI2009-03-16adrtradable
SBRCYSberbank Russia Sponsored American Depository Receipt (Russia)TrueRU2011-06-27adrtradable
SCHYYSands China Ltd Unsponsored ADR (Cayman Islands)TrueUS2010-07-26adrtradable
SCMWYSwisscom AG Common StockTrueCH2007-08-31adrtradable
SDVKYSandvik A B Sponsored ADR (Sweden)TrueSE2001-01-22adrtradable
SEKEYSeiko Epson Corp Suwa Unsponsored ADR (Japan)TrueJP2004-07-06adrtradable
SEOAYStora Enso Oyj Common StockTrueFI2007-12-31adrtradable
SFTBYSoftbank Group American Depositary Receipts – UnsponsoredTrueJP2010-07-27adrtradable
SGAPYSingapore Telecommunications Limited Sponsored ADR New 2006 (Singapore)TrueSG2006-09-06adrtradable
SGBLYStandard Bank Group Limited Sponsored ADR (South Africa)TrueZA2012-09-28adrtradable
SGSOYSGS SA ADR (Switzerland)TrueCH2007-04-16adrtradable
SGTPYSurgutneftegas PJSC American Depositary Receipts – SponsoredTrueRU2001-09-27adrtradable
SHCAYSharp Corp (Osaka) American Depositary Receipts – UnsponsoredTrueJP2017-10-02adrtradable
SHECYShin-Etsu Chemical Co Ltd Unsponsored ADR (Japan)TrueJP2008-11-25adrtradable
SHZHYSHENZHOU INTL GROUP HLDGS LTD American Depositary Receipts – UnsponsoredTrueHK2017-06-01adrtradable
SIEGYSiemens AG American Depositary SharesTrueDE1996-11-18adrtradable
SKFRYSKF AB American Depositary SharesTrueSE2003-09-23adrtradable
SKHHYSonic Healthcare Ltd American Depositary Receipts – SponsoredTrueAU2017-08-28adrtradable
SKHSYSekisui House Ltd American Depositary SharesTrueJP2001-04-17adrtradable
SLLDYSanlam Ltd Sponsored ADR (South Africa)TrueZA2009-11-25adrtradable
SMCAYSMC Corp Japan SPONSORED ADR (Japan)TrueJP2014-03-10adrtradable
SMFKYSmurfit Kappa Group Plc American Depositary Shares (Dublin)TrueIE2013-09-27adrtradable
SMGZYSmiths Group Plc Sponsored ADR (UK)TrueGB2010-11-01adrtradable
SMNNYSHIMANO INC American Depositary Receipts – Unsponsored (Japan)TrueJP2015-10-15adrtradable
SNPHYSanten Pharmaceutical Co Unsponsored American Depository Shares (Japan)TrueJP2011-08-31adrtradable
SOMLYSecom Co Ltd American Depositary SharesTrueJP2000-02-22adrtradable
SOMMYSumitomo Chemical Co Ltd Unsponsored ADR (Japan)TrueJP2010-04-06adrtradable
SONVYSonova Holding AG Unsponsored ADR (Switzerland)TrueCH2010-05-12adrtradable
SOUHYSouth32 Ltd American Depositary Receipts – Sponsored (Australia)TrueAU2015-05-18adrtradable
SPKKYSpark New Zealand Limited ADSTrueNZ2014-08-08adrtradable
SPXCYSingapore Exchange Ltd Unsponsored ADR (Singapore)TrueSG2012-05-22adrtradable
SSDOYShiseido Co Ltd Ord American Depositary SharesTrueJP2000-02-22adrtradable
SSEZYSSE Plc Sponsored ADR (United Kingdom)TrueGB2011-10-10adrtradable
SSMXYSysmex Corporation Unsponsored ADR (Japan)TrueJP2011-10-17adrtradable
SSREYSwiss Re Ltd Sponsored ADR (Switzerland)TrueCH2011-05-27adrtradable
SSUMYSumitomo Corp American Depositary SharesTrueJP2003-08-07adrtradable
STBFYSuntory Beverage & Food Ltd American Depositary Shares (Unsponsored)(Japan)TrueJP2013-10-11adrtradable
SUBCYSubsea 7 S.A. American Depositary SharesTrueGB2011-03-08adrtradable
SUHJYSun Hung Kai Pptys Ltd Ord American Depositary SharesTrueHK2000-02-22adrtradable
SVNDYSeven & I Holdings Co Ltd Unsponsored ADR (Japan)TrueJP2008-10-31adrtradable
SVNLYSvenska Handelsbanken Unsponsored ADR representing A Shares (Sweden)TrueSE2009-12-22adrtradable
SWDBYSwedbank AB Sponsored ADR (Sweden)TrueSE2006-10-03adrtradable
SWGAYSwatch Group Ag (The) Unsponsored ADR (Switzerland)TrueCH2010-03-22adrtradable
SWRAYSwire Pacific Ltd Sponsored ADR representing 1 Class A ShareTrueHK2000-02-22adrtradable
SYIEYSymrise Ag Unsponsored ADR (Germany)TrueDE2008-10-30adrtradable
SZKMYSuzuki Motor Corp Unsponsored ADR (Japan)TrueJP2010-02-12adrtradable
TCEHYTencent Holdings Limited Unsponsored ADR Representing B Shares (Cayman Islands)TrueCN2004-06-25adrtradable
TELNYTelenor ASA American Depositary SharesTrueNO2007-06-11adrtradable
TEZNYTerna Rete Elettrica Nazionale SPA Unsponsored American Depository Receipt (Italy)TrueIT2011-09-06adrposition_closing_only
TKOMYTokio Marine Holdings, Inc. Sponsored ADR (Japan)TrueJP2008-07-01adrtradable
TLSNYTelia Company AB American Depositary Receipts – UnsponsoredTrueSE2009-11-18adrtradable
TMSNYTemenos AG American Depositary Receipts – SponsoredTrueCH2016-11-07adrtradable
TOELYTokyo Electron Ltd Unsponsored ADR (Japan)TrueJP2009-01-21adrtradable
TRYIYToray Industries Inc ADRTrueJP2003-12-05adrtradable
TTDKYTDK Corporation Common StockTrueJP2009-04-27adrtradable
TTNDYTechtronic Industries Company Ltd American Depositary SharesTrueHK2001-11-05adrtradable
UMICYUmicore Group Unsponsored ADR (Belgium)TrueBE2011-10-06adrtradable
UNICYUnicharm Corp Sponsored ADR (Japan)TrueJP2012-07-23adrtradable
UOVEYUnited Overseas Bk Singapore American Depositary SharesTrueSG2000-02-22adrtradable
UUGRYUnited Utilities Group Plc Sponsored ADR (UK)TrueGB2008-07-28adrtradable
VDMCYVodacom Group Ltd. Sponsored ADRTrueZA2013-07-03adrtradable
VLVLYVolvo AB American Depositary Receipts – Unsponsored (Sweden)TrueSE2016-01-19adrtradable
VWAGYVolkswagen A G Unsponsored ADR Represent 1/10th ShTrueDE2018-08-09adrtradable
VWDRYVestas Wind Systems AS American Depositary SharesTrueDK2007-01-24adrtradable
WARFYWharf Holdings Ltd Ord Unsponsored ADR (Hong Kong)TrueHK2012-12-28adrtradable
WEGRYWeir Group PLC American Depositary Receipts – Sponsored (United Kingdom)TrueGB2016-03-14adrtradable
WEICYWeichai Power Co Ltd Unsponsored ADR (China)TrueCN2010-08-19adrtradable
WIMHYWilliam Hill Plc Unsponsored ADR (UK)TrueGB2010-07-22adrtradable
WJRYYWest Japan Railway Co Unsponsored ADR (Japan)TrueJP2011-01-25adrtradable
WOPEYWoodside Petroleum Ltd American Depositary SharesTrueAU2000-02-22adrtradable
WTBDYWhitbread PLC American Depositary Receipts – Sponsored (United Kingdom)TrueGB2017-10-24adrtradable
WTKWYWolters Kluwer N V Ord American Depositary SharesTrueNL2000-02-22adrtradable
YAHOYZ Holdings Corporation American Depositary Receipts – UnsponsoredTrueJP2009-07-29adrtradable
ZTCOYZte Corporation Unsponsored ADR representing H Shares (China)TrueCN2009-03-25adrtradable

I wrote up a short and dirty script in order to archive out all the Zoneminder events as mpeg files.   The script goes through and identifies all the events and creates a mpeg video file for each day of footage per camera (monitor).  I found this was the best way to keep the event organized and able to look up a particular day and monitor the easiest.  This is sort of a work in progress though, and for one of the awk statements, I had trouble incorporating the variable, so you may need to change it up slightly.

A prerequisite is that you will need to have FFMPEG installed on your system.  You may also have to change some of the parameters to match your systems, such as where the root directory for the event image files are as well as adjusting for the number of EVENT_IMAGE_DIGITS you are using in your zoneminder options/configuration.  I use 5 digits, but I believe the default is set to 3, which limits your events to 999 images.  Anyway, here it is.

archive_all script (zipped)

Maybe you can find this useful.

One site that I manage that has a lot of complex disease-related data that is given out for free to the public directly via the web site and also via an iOS app.  The entire site is dynamic and derived from multiple back end sources and subsequently causes a bit of a hit to render the information together.  We have often seen other entities (IPs originating from China & Germany recently) decide they want to “scrape” the entire site for all of the content without throttling their connections.  Due to our limited resources (only two front-end application servers), when someone hits us this way, this effectively creates a minor DoS for us.   The best place to try to control for these sort of scenarios would of course be at the load balancer device, but I don’t have control of configuration of them and so I have had to try to take matters into my own hands.

While there are quite a number of ways to cap someone’s impact on your server (mod_bw, mod_ratelimit, IP Tables, etc), most often, these are rendered fairly useless by the client’s IP being replaced by the IP of the LTM (traffic manager / load balancer).

Here’s how I effectively was able to limit other entities ability to hit our site beyond what it could handle.

Step 1:  Install mod_security (and mod_unique if not already loaded) – my mod_security was version 2.7 on CentOS

Step 2: Create a basic config for mod security
########## MOD SEC Basic Config File ###########
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule security2_module modules/mod_security2.so
SecRuleEngine On
SecDataDir /tmp
SecTmpDir /tmp
SecDebugLog /var/log/httpd_logs/modsec_debug.log
SecDebugLogLevel 0
##########################################

Step 3: Add the specific connection limiting configuration anywhere inside the VirtualHost directives of the site you are trying to protect:

####### SPECIFIC rate limiting for this site inside apache VirtualHost #########
<LocationMatch “^/(?!(?:jpe?g|png|bmp|gif|css|js|svg))(.*)”>
#counts everything but images and such
SecAction initcol:ip=%{X-Forwarded-For},pass,nolog,id:4444446
SecAction “phase:5,deprecatevar:ip.mysiteconncounter=1/1,pass,nolog,id:4444447”
SecRule IP:MYSITECONNCOUNTER “@gt 150” “id:4444448,phase:2,pause:300,deny,status:509,setenv:RATELIMITED,skip:1,nolog”
SecAction “id:4444449,phase:2,pass,setvar:ip.mysiteconncounter=+1,nolog”
Header always set Retry-After “15” env=RATELIMITED
</LocationMatch>
ErrorDocument 509 “Rate Limit Exceeded”
############## End rate limit configuration for virtual host here ###########

Step 4: Restart apache!

Some additional notes:
* You can limit what portion of your site is watched in the LocationMatch (instead of the whole site like I did)
* With Mod Security 2.7, I guess you need to add unique rule ID’s to each rule.  For these numbers I chose arbitrarily 4444446 – 4444449
* Change the “@gt 150” to a lower number if you want to lower the threshold for number of connections (each second the number of connections decreases by 1 for each IP) or the speed to which it deprecates the IP connection stat (1/1)
* If you would like to protect multiple sites (additional VirtualHosts on the same server), use a different variable for collecting IPs. In my case above I used “mysiteconncounter” so make sure it is something different, otherwise they will stomp on each other.
* You could probably return a different error code rather than 509 as it is only really partially supported out there.

 

Here’s a short little test that I worked up many years ago specifically for using for Linux SysOps candidates and I thought I would share it for anyone who would like to use it.  It measures a few things.  Firstly, of course, it tests for basic familiarity with Linux but more importantly, how well a candidate can follow instructions.  This is probably the most important trait to have where critical systems are involved and most of the operator actions are pre-scripted.  I have found the last part of the test on page 3 will identify detail-oriented candidates for you quite effectively and weed out the rest.  I’ve put it in PDF format so you can print it easily.

Click on the thumbnail below to download it.

Link for Linux Sys Ops test download
Click to download the Linux Sys Ops test (PDF format)

I’m sure the last part also can easily be adapted for other non-linux oriented roles that require good traits for focus, memory and precision.

I can post up the answer key, but really if you don’t already know the answers, you probably shouldn’t be administering this test!

Here’s the steps I had to take in order to add an encrypted listener in addition to the standard listener on an old Oracle instance.  Hopefully it may save you some time.. I had to futz around with it a bit until I got it going and then was able to deploy to some other servers in the same fashion:

STEP1 – – Go to the directory right above your “TNS_ADMIN” location.. typically it would be something like this:

cd /u01/product/11.2.0/dbhome_1/network/

STEP2 – – Create a new “admin2” directory

mkdir /u01/product/11.2.0/dbhome_1/network/admin2

STEP3 – –  Create new listener.ora and sqlnet.ora files in the new admin2 directory, and customize for your particular instance.  I arbitrarily picked port 11521 because it would be easy to remember for me.

####### listener.ora ########

SSL_CLIENT_AUTHENTICATION = FALSE

ENCRYPTED_LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = FQDN.DB.HOSTNAME)(PORT = 11521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC11521))
)
)

ADR_BASE_ENCRYPTED_LISTENER = /u01
SECURE_REGISTER_LISTENER_PROD = (IPC)
####### sqlnet.ora ########

SQLNET.AUTHENTICATION_SERVICES= (BEQ, TCPS)
SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER= (SHA1, MD5)
SSL_VERSION = 0
SQLNET.ENCRYPTION_SERVER = required
SSL_CLIENT_AUTHENTICATION = FALSE
SQLNET.CRYPTO_SEED = ‘SomeCrazyCryptoSeedWhateverYouWantHere’
SQLNET.ENCRYPTION_TYPES_SERVER= (AES256)
SSL_CIPHER_SUITES= (SSL_RSA_WITH_AES_256_CBC_SHA)
SQLNET.EXPIRE_TIME=60

STEP4 – – Next we will need to register the new listener to let the DB know about the regular one and the new encrypted one (or more if you’d like).  I’m doing this in the TNSNAMES.ORA file and calling it “ALL_LISTENERS”.

In my case this was located in the regular TNS_ADMIN home location: /u01/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

#######
ALL_LISTENERS=
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = FQDN.DB.HOSTNAME)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = FQDN.DB.HOSTNAME)(PORT = 11521))
)
####

Then in SQLPLUS as the SYSDBA you will need to run:

SQL> ALTER SYSTEM SET LOCAL_LISTENER=ALL_LISTENERS;
———————————————————–
Note: You may have to stop everything and restart the DB at this point… but it may not be necessary.  I just did it to make sure everything was clean.

STEP5 – – Start up your standard listener first as usual:

lsnrctl start

Next follow this procedure in order to start the second encrypted listener:

cd /u01/product/11.2.0/dbhome_1/network/admin2
export TNS_ADMIN=`pwd`
lsnrctl start ENCRYPTED_LISTENER

After a minute or so you should be able to see that the listener status is READY, and has 1 handler(s) for this service by running the command:

lsnrctl status ENCRYPTED_LISTENER

Hopefully this is straight forward enough.  I hate reading Oracle docs and would rather just have an example cookbook approach, so if you are like me maybe you will appreciate this.

–Cheers!

I have a data center that I don’t physically visit very often.  Recently I’d replaced some UPS units that conveniently had some external temperature sensors on them which I used to use to monitor the environmental temperature.  One of my HVAC units does report temperature, but because it isn’t too close to the main equipment rack, I really wanted to know what sort of temperature my servers were experiencing directly in the rack.  I finally came up with a way to do this with some of my HP ProLiant DL360 G7s.  I used to do this with Dell’s that had built-in temperature sensors, but we don’t have any of them around any more.   The hardest part of the process was figuring out all the necessary drivers and agents required to get the sensors monitored and able to be queried by snmp on the HPs.

First thing you need to do is download and install the HP Health command line utility and snmp agents on your server that needs to be monitored.  I located them by going to http://www.hp.com and then Support > Put in “DL360 G7” as model > Linux > choose “Software – System Management”  category > Download both the HP SNMP Agents for Linux as well as the HP Health command line utility.

Then I installed them and some standard RHEL packages:

# rpm -ivh ./hp-health-10.10-1710.30.rhel6.x86_64.rpm
# rpm -ivh ./hp-snmp-agents-10.10-2732.25.rhel6.x86_64.rpm
# yum install net-snmp net-snmp-utils lm_sensors

** Don’t forget to edit the /etc/snmp/snmpd.conf file to allow only appropriate access **
I’m not going to detail these steps in particular as this is more generic setup that you find in the man pages, etc. However, you WILL need to source the dlmod for the HP agent as follows in the snmpd.conf file as shown below:

dlmod cmaX /usr/lib64/libcmaX64.so

– – Or you can alternatively run:
# /sbin/hpsnmpconfig

(And then chose to use existing snmpd.conf, or create a new one.  However, I found it easier to  simply add in the dynamic module as I did above.)

** Also, I ran through the sensors-detect in order to see if there was anything else I could monitor of interest
# sensors-detect

…and chose to update the config file when prompted “Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no): YES”

Once all that was done I gave the new services a clean start if they weren’t already running and made sure they start at boot time:
# /etc/init.d/hp-snmp-agents restart
# /etc/init.d/snmpd restart
# chkconfig snmpd on

Now for the fun part!

I searched around online and figured out the at the Health / thermal MIB OIDS start at: 1.3.6.1.4.1.232.6.2.6 -ish
and that temp Sensor locations by INTEGER can be identified as follows: (I was really only interested in the ambient “11” sensor for this project, but you could track whichever ones you really wanted)

Locations: other(1), unknown(2), system(3), systemBoard(4), ioBoard(5), cpu(6),
memory(7), storage(8), removableMedia(9), powerSupply(10), ambient(11),
chassis(12), bridgeCard(13)

So then, from using the SNMPWALK utility I was able to derive all the available sensor locations:
e.g.  snmpwalk -Of -c public -v 1 localhost 1.3.6.1.4.1.232.6.2.6.8

.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.1 = INTEGER: 11
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.2 = INTEGER: 6
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.4 = INTEGER: 7
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.5 = INTEGER: 7
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.7 = INTEGER: 7
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.9 = INTEGER: 7
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.11 = INTEGER: 7
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.12 = INTEGER: 10
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.13 = INTEGER: 10
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.14 = INTEGER: 7
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.15 = INTEGER: 6
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.16 = INTEGER: 6
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.17 = INTEGER: 7
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.18 = INTEGER: 6
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.19 = INTEGER: 3
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.20 = INTEGER: 3
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.21 = INTEGER: 3
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.22 = INTEGER: 3
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.23 = INTEGER: 3
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.24 = INTEGER: 3
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.25 = INTEGER: 3
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.26 = INTEGER: 3
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.27 = INTEGER: 8
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.3.1.28 = INTEGER: 3

And what the current reading in Celsius of the sensor is:

.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.1 = INTEGER: 22
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.2 = INTEGER: 40
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.4 = INTEGER: 34
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.5 = INTEGER: 33
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.7 = INTEGER: 31
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.9 = INTEGER: 32
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.11 = INTEGER: 32
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.12 = INTEGER: 34
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.13 = INTEGER: 45
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.14 = INTEGER: 29
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.15 = INTEGER: 31
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.16 = INTEGER: 31
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.17 = INTEGER: 28
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.18 = INTEGER: 40
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.19 = INTEGER: 35
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.20 = INTEGER: 37
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.21 = INTEGER: 43
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.22 = INTEGER: 45
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.23 = INTEGER: 40
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.24 = INTEGER: 48
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.25 = INTEGER: 36
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.26 = INTEGER: 48
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.27 = INTEGER: 35
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.28 = INTEGER: 72

So, e.g. specifically looking at the “Ambient Sensor” we see a reading of 22 degrees Celsius (~71 deg F)
# snmpwalk -Of -c public -v 1  localhost 1.3.6.1.4.1.232.6.2.6.8.1.4.1.1
.iso.org.dod.internet.private.enterprises.232.6.2.6.8.1.4.1.1 = INTEGER: 22

Then on my Nagios server, I defined the new service and all the other params and restarted Nagios.  Below are the config files and custom commands I set up for this (your set up may be slightly different, but pretty close):

** /etc/nagios/conf.d/service_templates.cfg

define service {
register                0
use                     default-service
name                    hp_check_ambienttemp
service_description     HP Ambient Temperature
servicegroups           hpenv
check_command           snmp_hpenv_ambienttemp!public
}

** /etc/nagios/servers/servername.cfg

define host {
host_name    someservername
address        someservername.fqdn
hostgroups    acceptance
alias        Some HP DL360 G7 Server
use        server
}

define service {
host_name    someservername
use        ping,lowpriority
}

define service {
host_name        someservername
use            hp_check_ambienttemp,graph,critical
notifications_enabled     0
}

** /etc/nagios/conf.d/commands.cfg  (Note how I set 25 degrees as the warning threshold and 26 degrees as critical)

# ‘snmp_hpenv_ambienttemp’ command definition
define command {
command_name    snmp_hpenv_ambienttemp
command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.232.6.2.6.8.1.4.1.1 -w 25 -c 26 -l ‘\Ambient Air Temp\’ -u ‘\Celcius\’
}

** /etc/nagios/conf.d/servicegroups.cfg

define servicegroup {
servicegroup_name       hpenv
alias                   HP Server Envir Monitors
}

———

Here’s what the result is in Nagios.. (also, graphing is a good idea, but that could be another post).

screensht_nag

We ended up getting a new Challenger 3000 Liebert (Emerson Power) HVAC unit in our data center recently.  We typically monitor everything using the Nagios system for our servers and we were pleased to find that inside the Liebert toward the top was a component that they refer to as the “Unity” module.  After reading some online user guides I was able to bind an IP to it and start querying it via SNMP.  Hint: the default username and password to get in to the web interface were both “Liebert”.  After looking around for a bit, I realized there weren’t any stock commands in Nagios via the check_snmp plugin to handle this, so I added some of my own.  Using snmpwalk, I was able to determine which of the OIDs I was interested in and made some custom command definitions.

Here’s the command definitions:

##########################################
# ‘snmp_lbenv_humidity’ command definition – consider anything under 21 percent critical
define command {
command_name    snmp_lbenv_humidity
command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.476.1.42.3.9.20.1.20.1.2.1.5028 -l ‘\Return Humidity\’ -u ‘\%\’ -c @0:20.9 -w @21:35
}

# ‘snmp_lbenv_returnairtemp’ command definition – critical at 24 or more degrees Celcius
define command {
command_name    snmp_lbenv_returnairtemp
command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.476.1.42.3.9.20.1.20.1.2.1.4291 -w 23 -c 24 -l ‘\Return Air Temp\’ -u ‘\Celcius\’
}

# ‘snmp_lbenv_hvacstatus’ command definition
define command {
command_name    snmp_lbenv_hvacstatus
command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.476.1.42.3.9.20.1.20.1.2.1.4123 -l ‘\HVAC Status\’ -u ‘\Normal vs Abnormal\’ -s ‘”Normal Operation”‘
}

##########################################

I also set up nagiograph plugin in order to give me a quick historical overview of the changes in temperature and humidity.

HVAC

Pretty neat way to monitor the Liebert without having to set up anything additional!

I was stumped for a while trying to figure out how to provide a Git repo via HTTP(s) in order to allow a separate group of ldap authenticated users to have read-only access to each individual repos while another group in A/D has full read-write access.  Here’s what I finally came up and included in my apache’s conf file to make it work:

<Location /git/MyGitRepo>
Require ldap-group CN=MyGitRepoRO,OU=Git Security Groups,OU=Organizational Units,DC=ds,DC=dinkyuniversity,DC=edu
</Location>

<LocationMatch “^/git/MyGitRepo/git-receive-pack$”>
Require ldap-group CN=MyGitRepoRW,OU=Git Security Groups,OU=Organizational Units,DC=ds,DC=dinkyuniversity,DC=edu
</LocationMatch>

As you can see above, basically the trick I figured out was to limit access for the “git-receive-pack” command for a separate group of people needing the read-write access.  Users needing RW access must also exist in the RO group as well.

At some point in time late in March 2013, an update to my Mac broke the ldapsearch functionality.  I had a simple script written with a menu that would allow me to query the school’s directory for commonly needed info such as usernames, phone numbers, departments and so on.

Everything worked wonderfully until last month I started receiving this error:

ldap_sasl_bind(SIMPLE): Can’t contact LDAP server (-1)

After a lot of googlin’ most people receiving this error suggested adding either of these to my ldap.conf file

TLS_REQCERT    never
or
TLS_REQCERT     allow

Unfortunately, neither of these made any difference.  How frustrating.  After a while I came to the realization that the ldapsearch was not longer looking at the configuration file in the standard location /etc/openldap/ldap.conf

On the Mac, using the dtruss command (similar to strace), I was able to track down where it was looking for the file by a command similar to this:

sudo dtruss -a ldapsearch [rest of the query here] 2>&1 |grep conf

which gave me what I was looking for…
346/0x2f28:    247865   12423    152 open_nocancel(“/opt/local/etc/openldap/ldap.conf\0″, 0x0, 0x1B6)         = 3 0

No file existed there yet, so a simple symlink to my original configuation file fixed my ldapsearch!

sudo  ln -s /etc/openldap/ldap.conf /opt/local/etc/openldap/ldap.conf