Search This Blog

Thursday, June 16, 2016

Revisiting installing guest additions on Virtual box for CentOS 7

Toying with docker, I found myself with an upgraded version of Virtual Box, and a new virtual machine brought me to the old issue of the pre-configuration needed for installing guest additions on CentOS 7. Things have become simpler: 

1) The Extra Packages for Enterprise Linux repository is now better embedded, and therefore the following suffices to define it:
     yum install epel-release 
2) Having the new repositry, we can easily install dkms
    yum install dkms 

And surprisingly, this solves all dependencies required for the guest additions... (at least it solved it for me, in a base+X installation). 

so afterwards, we can run the guest additions installer, and see it complete. 

Screen shot of the Installation of Virtual Box Guest Additions for Linux

Friday, June 10, 2016

האם תוכל לכתוב לי מהן הפקודות הבסיסיות ביותר ב - SQL בבקשה?

חבר שאל את השאלה "האם תוכל לכתוב לי מהן הפקודות הבסיסיות ביותר ב - SQL? ", כהכנה ליום עיון. גירדתי מעט בראש, ומאחר ולא היה לי זמן להתחיל לחפש מדריך בסיסי טוב באמת לSQL ברשת, חשבתי שיהיה הכי מהר לשרבט משהו בעצמי, אז שלחתי לו את התשובה הבאה (ואחרי ששלחתי, חשבתי שעדיף לשמור אותה כאן, למקרה הצורך):

1. אני ממליץ שתוריד ותתקין את הכלי הבא - SQLITE - מאוד פשוט לתפעול.
(מהקישור, מה שאתה צריך זה תחת Precompiled Binaries for Windows
את sqlite-tools-win32-x86-3130000.zip )

2. אחרי שתוריד, unzip אותו, תוכל להריץ את התוכנית sqlite3 .

3. בתמצית, SQL, שהיא כלי לעיבוד מידע, נחלקת לפקודות הגדרה, פקודות שליפה (יותר נכון, פקודת שליפה) ופקודות מניפולציה.  (זו אמירה גדולה ולא מדוייקת אבל מספיקה לשלב הראשוני הזה). מי שמבקש יותר יכול להציץ בערך ויקיפדיה של SQL.

הגדרה: create.
למשל בsqlite שהגדרנו, הקש את הפקודה הבאה:
create table t1 (n1 number, v1 varchar2(1000));

עיבוד: insert, update וdelete
למשל, בsqlite שהגדרנו, הקש את הפקודה הבאה:
insert into t1 values (1,'hello');

שליפה:  select
למשל, בsqlite שהגדרנו, הקש את הפקודה הבאה:
select * from t1;

ואם נצטט מתוך ויקיפדיה:
"משפט SELECT, מאחזר נתונים מתוך טבלה (או מספר טבלאות), אבל לא מבצע בהם שינויים קבועים.
DML - שפת מניפולציה בנתונים (Data Manipulation Language) - שפה המשמשת לטיפול בנתונים עצמם
משפט INSERT מוסיף שורות חדשות לטבלה.
משפט UPDATE מעדכן נתונים בשורות הקיימות בטבלה.
משפט DELETE מוחק שורות נתונים מטבלה".

4. כדאי להציץ בויקיפדיה, לראות כמה דוגמאות בסיסיות קצת יותר מתקדמות שמובאות שם. ובכל זאת, למען התמציתיות, כמה דוגמאות יחד עם הפלט מsqlite:

sqlite> insert into t1 values (2,'there');
sqlite> select * from t1;
1|hello
2|there

sqlite> update t1 set n1=3 where n1=1;
sqlite> select * from t1;
3|hello
2|there

sqlite> delete from t1 where v1='there';
sqlite> select * from t1;
3|hello

sqlite> insert into t1 values (4,'b la bla ');
sqlite> select * from t1;
3|hello
4|b la bla

sqlite> select * from t1 where n1=4;
4|b la bla

sqlite> select * from t1 order by n1 desc;
4|b la bla
3|hello

דברים שיכולים לעזור