Skip to content

Instantly share code, notes, and snippets.

View frayos's full-sized avatar

Younes frayos

View GitHub Profile
@frayos
frayos / testEncoding_version_ANSI.sas
Created January 18, 2018 14:34
testEncoding_version_ANSI.sas
/************************************************************
Author Nicolas Housset
Juillet 2017
https://r12a.github.io/apps/encodings/
http://r12a.github.io/apps/listcharacters/
http://r12a.github.io//apps/conversion/
https://sites.google.com/site/nathanlexwww/tools/utf8-convert
************************************************************/
@frayos
frayos / pslsofSASServers.sh
Last active January 18, 2018 14:37
ps / lsof / lsof LISTEN SASServers
#!/bin/sh
####
## Works with this format (pid is 1st numeric field)
#### admsas 3157 0.1 2.2 2718092 367104 ? Sl Jan15 4:44 /sharedsas/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/java
###
TRACK=7612XXXXX
OUTDIR=/tmp/$TRACK
mkdir $OUTDIR
###
for i in SASServer1_1 SASServer1_2 SASServer2_1 SASServer7_1 SASServer11_1 SASServer12_1 SASServer13_1 SASServer14_1 SASServer15_1
@frayos
frayos / metaLogging.sas
Created January 19, 2018 13:23
Meta Auth Logs
/* LIST */
proc iomoperate;
connect host='host-name' port=port-number user='user-ID' pass='password';
list attributes category="Loggers";
list attributes category="Properties";
quit;
/* CHANGE */
@frayos
frayos / db2Diag.sas
Created January 19, 2018 14:51
DB2 Diagnosis from SAS
/********* DB2 ONLY on UNIX/WINDOWS ********/
data _null_;
%put USERID = &sysuserid;
length x $500;
a1=sysget('LIBPATH');
a2=sysget('LD_LIBRARY_PATH');
a3=sysget('SHLIB_PATH');
a4=sysget('PATH');
b=sysget('INSTHOME');
c=sysget('DB2INSTANCE');
@frayos
frayos / timeSDW.sh
Created January 22, 2018 16:17
Change Date Modification time for SDW logs in case of wrong transfer
#!/bin/bash
##################################################
##################################################
#FOR SAS DEPLOYMENT WIZARD LOGS #################
##################################################
##################################################
##################################################
NEWIDR=NEW/
mkdir $NEWDIR
@frayos
frayos / timeConfigure.sh
Created January 22, 2018 16:18
Change Date Modification time for SDM logs in case of wrong transfer
#!/bin/bash
##################################################
##################################################
#FOR SAS Lev Logs Configure #################
##################################################
##################################################
##################################################
NEWDIR=CHANGED/
mkdir $NEWDIR
@frayos
frayos / copy_to_new_encoding.sas
Created January 29, 2018 16:45
copy_to_new_encoding
/* DOC FROM http://go.documentation.sas.com/?docsetId=nlsref&docsetTarget=p1g1d26os4w0von1cdfh827foo3r.htm&docsetVersion=9.4&locale=en */
%macro copy_to_new_encoding(from_dsname,to_dsname,new_encoding);
%let prefix=goobly;
data _null_;
file lngtstmt;
put ' ';
run;
data temp2;
x=1;
@frayos
frayos / Jdbctest.sh
Last active June 5, 2018 12:23
jdbc testing
###### UNIX cp : separated
/sas/SASHome3/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/java
-Djdk.tls.client.protocols="TLSv1.2"
-cp /sas/msjdbc/mssql-jdbc-6.2.2.jre7.jar:./
JdbcTest
com.microsoft.sqlserver.jdbc.SQLServerDriver
"jdbc:sqlserver://s-msk-t-fps-DB2:1433;databaseName=FPSDB;encrypt=true;trustServerCertificate=true;"
yyyy xxxxx
#### WINDOWS cp ; separated
@frayos
frayos / openstack.sh
Created February 2, 2018 10:21
openstack controller
#!/bin/sh
export OS_AUTH_URL=https://sashq-r.openstack.sas.com:5000/v2.0
export OS_PROJECT_NAME=dept-tsg
export OS_USERNAME=frayos
export OS_PASSWORD=XXXXXXXXXXXXXXX
#glance image-list
#openstack image list
glance image-list
glance image-download --file /home/cloud-user/open.qcow2 --progress 44ab2b78-6da5-41d1-95a7-57bed001b52c
@frayos
frayos / credentialGuard.ps1
Created February 5, 2018 13:04
Credential Guard checker Powershell
$DevGuard = Get-CimInstance –ClassName Win32_DeviceGuard –Namespace root\Microsoft\Windows\DeviceGuard
if ($DevGuard.SecurityServicesConfigured -contains 1) {"Credential Guard configured"}
if ($DevGuard.SecurityServicesRunning -contains 1) {"Credential Guard running"}