Skip to content

Instantly share code, notes, and snippets.

View jayanath's full-sized avatar

Jayanath Amaranayake jayanath

View GitHub Profile
@jayanath
jayanath / CKA_Bookmarks.html
Created April 13, 2024 07:02
Kubernetes documentation bookmarks for CKA
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1709613089" LAST_MODIFIED="1710797627" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Bar</H3>
<DL><p>
@jayanath
jayanath / gist:2707174e3ee729be135a9dafe57d60a1
Last active July 6, 2021 12:56
Setup UUID for new virtual hard disk - virtualbox - macOS
# virtualbox gives a "disk with same UUID is already mounted" error when trying to launch
# multiple virtual machines using VDI files of a same osboxes images.
# to avoid this error we can set uuid of the virtual disk as follows
> cd /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/
> VBoxManage internalcommands sethduuid <full path to the vdi file>
You should receive a message like below confirming the new uuid
UUID changed to: 98axxxxxx-f0xx-420x-9179-a33805xxxx

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

[java] ***Setter Injection: Service name to internet service instance
[java] ***Setter Injection: Service name to food service instance.
[java] ***Setter Injection: Service name to laundry service instance
[java] ***Setter Injection: Service name to telephone service instance
[java] ***Constructor Injection: Room type into the room instance
[java] ***Setter Injection: List of services in to the room instance
[java] Created the ApplicationContext based on the appconfig.xml file
[java] Got the Room instance
[java] Room Type : Monte Carlo
[java] The room charge is 63.19 with the following services :
@jayanath
jayanath / Main_3.java
Created July 30, 2012 20:38
Room bean instance
//xml based config
room = (Room) xmlCtx.getBean(Room.class);
//annotation based config
room = (Room) annCtx.getBean(Room.class);
@jayanath
jayanath / Main_2.java
Created July 30, 2012 20:36
Main with Annotations
AnnotationConfigApplicationContext annCtx = new AnnotationConfigApplicationContext();
annCtx.register(AppConfig.class);
annCtx.refresh();
@jayanath
jayanath / Main_1.java
Created July 30, 2012 20:35
Main with XML
ApplicationContext xmlCtx = new ClassPathXmlApplicationContext("appconfig.xml");
@jayanath
jayanath / Room_constructor.java
Created July 30, 2012 20:29
Room constructor
Room r = new Room("Monte Carlo");
@jayanath
jayanath / Room_Bean.xml
Created July 30, 2012 20:10
Room bean xml
<bean id="Room" name="Room" class="com.jayanath.spring.Room">
<constructor-arg name="roomType" value="Monte Carlo"/>
</bean>
@Bean
public Room room() {
Room r = new Room("Monte Carlo");
List<Service> list = new ArrayList<Service>();
list.add(internet());
list.add(telephone());
r.setServiceList(list);
return r;
}