Search for oracle objects in unix scripts with specific name.

Search for oracle objects in unix scripts with specific name. On Unix: 1. Search script with “prm_” in the text: find . -name ‘*’ -print | xargs grep -i ‘prm_’ > /tmp/all_files On Client 2. Copy file (with winscp) to local dir. 3. Remove all ‘binary shit’ lines 4. Create on Oracle some table with […]

What’s that script doing

Found this script on some media hard drive…. #!/bin/sh SAVEIFS=$IFS IFS=$(echo “\n\b”) for f in * do if [ ! -d “/media/usbdisk/kidz/$f” ] then echo $(du -sh “$f”) fi done IFS=$SAVEIFS Very curious why I left it there and what is was looking for. IFS is the field splitting \n\b is…. \b = character \n […]

minimalize raspian

sudo apt-get remove –purge wolfram-engine scratch omxplayer penguinspuzzle sudo apt-get remove –purge debian-reference-en dillo idle3 python3-tk idle python-pygame python-tk sudo apt-get remove –purge lightdm gnome-themes-standard gnome-icon-theme raspberrypi-artwork sudo apt-get remove –purge gvfs-backends gvfs-fuse desktop-base lxpolkit netsurf-gtk zenity xdg-utils sudo apt-get remove –purge mupdf gtk2-engines alsa-utils lxde lxtask menu-xdg gksu sudo apt-get remove –purge midori xserver-xorg […]

Just ….

select column_name , case data_type when ‘NUMBER’ then data_type||’ (‘||data_precision || case when data_scale != ‘0’ then ‘,’||data_scale else ” end ||’)’ when ‘VARCHAR2′ then data_type||’ (‘||data_length||’ ‘||case char_used when ‘B’ then ‘Byte’ when ‘C’ then ‘Char’ end ||’)’ when ‘DATE’ then data_type end datatype , case nullable when ‘N’ then ‘Not Null’ else ” […]

ufw

setting ufw rules….. 1. Read the rules: ~$ sudo ufw status numbered Status: active To Action From — —— —- [ 1] Anywhere DENY IN xxx.xxx.xxx.xxx [ 2] Anywhere DENY IN xxx.xxx.xxx.xxx [ 3] 22 ALLOW IN Anywhere [ 4] 80 ALLOW IN Anywhere [ 5] 25 ALLOW IN Anywhere [ 6] 22 (v6) ALLOW […]

How to exit some bulk collect loop

declare cursor c_cur is select id from sometable; — type t_cur is table of c_cur%rowtype index by binary_integer; a_cur t_cur; l_limit binary_integer := 1000; begin — open c_cur; — loop fetch c_cur bulk collect into a_cur limit l_limit; exit when c_cur%notfound; /*[some code]*/ end loop; — close c_cur; — end; declare cursor c_cur is select […]

change default text editor in Ubuntu

The default editor for crontab on Ubunut is Nano. I don’t like it. I just like vi (or the vim version for linux). According to the official notes about changing the default editor, I should use this command: $ sudo update-alternatives –config editor This gives a screen like this: $ sudo update-alternatives –config editor [sudo] […]

cleaning up, weeknumber in php…

<?php setlocale(LC_ALL, ‘nl_NL’); $weeknrkeep=-1; $today = time(); echo $today.”<br>”; for ($i=0;$i<200;$i++) : $weeknr= strftime(‘%V’, strtotime(‘+’.$i.’ day’,$today)); if ($weeknr != $weeknrkeep): echo “<br><strong>week “.$weeknr.”</strong><br>”; endif; echo strftime(‘%a %d-%m-%Y’, strtotime(‘+’.$i.’ day’,$today)).”<br>\n\r”; $weeknrkeep=$weeknr; endfor; ?> this outputs a list of weeknumbers and the days’s and dates in that week. must have been some test for some website….. output […]

Cleaning up, found some bits of code…

#include <stdio.h> #include <math.h> int main(int argc, char **argv) { float h; printf( “aantal argc: %d\n” ,argc); printf( “argv0: %s\n”, argv[0]); printf( “argv1: %s\n”, argv[1]); h=0x3fff; /* 16 * 16^0 16 * 16^1 16 * 16^2 3 * 16^3 = 16656 */ printf( “h: %f\n”, h); h=(100.0 / h); printf( “h: %f\n”, h); return 0; […]