Exercise 2: Communicate with a book service
In this exercise you will extend a provided Xamarin.Forms application to work with an existing REST service which manages a library of books. You will authenticate with the service, retrieve existing books, add new books, update books and delete books from your bookshelf.
To complete the exercise, you will need Visual Studio for Windows or macOS with the Xamarin development tools installed. You will also need either an emulator/simulator or a device to run the exercise on. Please see the setup page if you need help installing the Xamarin development environment.
Explore the REST service
This exercise uses an existing REST service. This part covers the capabilities of the service; there is no code to write here.
The Book service is located at http://xam150.azurewebsites.net/api/books. This URL alone will return an HTTP 401 error. Here are the valid operations you can perform with this API using an HTTP request tool:
- Call
GET /login
to get a token (if you don't pass this token to the other methods, you'll get anUnauthorized
status returned). This will create a unique session for your application and will populate the session with a few default books. - All other calls need to add the string-based token (with no quotes) as the
Authorization
header. This is what identifies you to the service. In addition, you should set theAccept
header toapplication/json
. - Call
GET
to get a list of the books in your session. This will return a JSON array of books which have the shape:
[
{
"isbn":"1025801012",
"title":"Answers to Absurd Hypothetical Questions",
"authors":["Randall Munroe"],
"publishDate":"2014-09-04T00:00:00+00:00",
"genre":"Nonfiction"
}
]
- Call
PUT /xxxx
to update a book, wherexxxx
is the ISBN code for an existing book with the JSON book as the body of the request. - Call
DELETE /xxxx
to delete a book, wherexxxx
is the ISBN code for the book. - Call
POST
to add a new book, with the JSON book as the body of the request, the ISBN code must be empty. This will return the JSON book with the ISBN code filled in.
Open the starter solution
This exercise utilizes a provided solution. Open the Exercise 2 > Start solution from your copy of the cloned or downloaded course materials in either Visual Studio for Windows or Visual Studio for Mac.
Examine the project structure. It has several projects in the solution.
The BookClient project is the PCL which contains all the code to create and process the UI for the application. You will do all of your work in this project. There are two Page
classes in the project, one for the main view which shows a ListView
for the books, and a second to add or edit a specific book.
The remaining projects are platform-specific. You will not need to modify any code in these projects; however, you will need to add packages to them and select one as your Startup Project for testing.
Add the NuGet packages
Here you will add the NuGet packages you will need and to make sure the app builds correctly.
- Add the Microsoft HTTP Client Libraries, Microsoft.Net.Http, NuGet package to the BookClient PCL project. It is not necessary to install it in the platform-specific projects.
To add this NuGet package via the Package Manager Console, found in the menu under Tools > NuGet Package Manager > Package Manager Console, run the following command:
Install-Package Microsoft.Net.Http
- Add the Json.NET NuGet package to the BookClient project and to any platform projects you intend to test with (iOS, Android and/or Windows). If you are using Visual Studio on Windows, you can do this at the solution level by right-clicking on the solution node and selecting Manage NuGet Packages for Solution. On Visual Studio for Mac, you will need to add the packages individually to each project through Add > Add Packages....
To add this NuGet package via the Package Manager Console, found in the menu under Tools > NuGet Package Manager > Package Manager Console, run the following command:
Install-Package Newtonsoft.Json
- You should be able to build the application, but do not attempt to run it yet as it has some unimplemented methods which throw exceptions.
- If your project builds correctly then you are done with this part. If not, you could be encountering a bug. When you add Microsoft HTTP Client Libraries to your projects, NuGet will also add dependencies to a few other packages to provide compile-time dependencies against core BCL classes. There is a known problem with certain versions of the NuGet client which causes a build error in the Xamarin.iOS and Xamarin.Android projects when they have a reference to these build packages. The error message will say something similar to:
warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
To resolve this issue, remove the following references from the Xamarin.iOS and Xamarin.Android platform-specific project - leave the package, just delete the references from the References folder. You should be able to build at that point. * System.Runtime * System.IO * System.Threading.Tasks
For more information on this error, see this MSDN blog post.
Examine the Book and BookManager classes
The service works with a set of books described in JSON. We've added a JSON parser (Json.NET), and have some code in the project for the object representation of the book.
- Expand the Data folder. You will find two files inside.
| Source File | Description |
|---|---|
| Book.cs | This is the object representation for a single book. The definition should match the JSON description above. It has public properties defined for each of the passed fields. Json.NET is smart enough to manage camel-casing vs. pascal-casing so you can name the properties with standard C# conventions, the key thing is that the names are spelled correctly. |
| BookManager.cs | This is the manager class which wraps the web service. It has stubbed out methods (with NotImplementedException code) for each of the operations you need to implement. The UI already has code in place to call each of these methods. |
Login to the service
The service requires you "login" first to get a token. There is no user authentication (i.e. you do not have to enter any credentials); however, you must call a specific endpoint first to get a token. You must then send the token back to the server on each subsequent request in the HTTP header.
- In the Data folder, open BookManager.cs.
- Add the following field to your code. This is the base address of the service.
const string Url = "http://xam150.azurewebsites.net/api/books/";
- Add the following field to hold the token.
private string authorizationKey;
- Create a
private
method namedGetClient
which returns aTask<HttpClient>
.
private async Task<HttpClient> GetClient()
{
...
}
-
In the method, create a new
HttpClient
. -
If this is the first time the method has been called, then the
authorizationKey
field will not be set. In this case, you need to useGetStringAsync
with the base URL +login
to get the token. -
The returned token will have quotes around it which need to be removed. An easy way to do this is to use
JsonConvert.DeserializeObject<string>(...)
. Save the result into theauthorizationKey
field. -
Add an
Authorization
header to theDefaultRequestHeaders
collection of theHttpClient
. Use the token as the value. -
Add an
Accept
header to theDefaultRequestHeaders
collection of theHttpClient
. Useapplication/json
as the value. -
Return the
HttpClient
object from the method.
private async Task<HttpClient> GetClient()
{
HttpClient client = new HttpClient();
if (string.IsNullOrEmpty(authorizationKey))
{
authorizationKey = await client.GetStringAsync(Url + "login");
authorizationKey = JsonConvert.DeserializeObject<string>(authorizationKey);
}
client.DefaultRequestHeaders.Add("Authorization", authorizationKey);
client.DefaultRequestHeaders.Add("Accept", "application/json");
return client;
}
Perform a GET operation
Now that we can authenticate to the service, let's add our code to retrieve the books from the base Url.
- In the BookManager.cs file, find the method named
GetAll
which returns aTask<IEnumerable<Book>>
. - Use your
GetClient
method to retrieve anHttpClient
to work with. - Use
GetStringAsync
on the base Url to retrieve the array of books. You can use the C#async
/await
feature to make this easy to consume - make sure you add theasync
keyword to the method definition. - Pass the returned string into
JsonConvert.DeserializeObject
to turn the JSON data into an object graph and return it back to the caller.
public class BookManager
{
...
public async Task<IEnumerable<Book>> GetAll()
{
HttpClient client = await GetClient();
string result = await client.GetStringAsync(Url);
return JsonConvert.DeserializeObject<IEnumerable<Book>>(result);
}
}
- Run the application and press the Refresh icon in the toolbar (at the top or bottom depending on the platform, but the icon looks like a pair of arrows in a circle).
- After a few seconds, the app should load a set of existing books and display them. Debug through the application if you do not see the data get loaded. Verify it is properly calling
Login
and then passing the authorization token into theGET
call to retrieve the books.
Perform a POST (add) operation
We are now displaying the books, let's add support to add a new book using POST.
- Open the
BookManager
code and locate the method namedAdd
which takes a title, author and genre and returns aTask<Book>
. -
In the method, create a new
Book
object and populate the fields with the passed data:- Set the
ISBN
field to an empty string. - Make sure to create a new
List
to hold the passed author (we only allow a single author here for simplicity, but you could expand this code if you like to allow for multiples using a comma separator or some other convention). - Set the
PublishDate
toDateTime.Now
.
- Set the
-
Get a client from your
GetClient
method. -
Use the
PostAsync
method against the base URL to add the book.- You will need to turn the
Book
object into JSON usingJsonConvert.SerializeObject
. - Create the
HttpContent
from the JSON string by creating a newStringContent
object, use the constructor which also takes an encoding and media type. - The encoding should be
Encoding.UTF8
and the media type should beapplication/json
.
- You will need to turn the
-
The response from POST will be a JSON string represent the returned book. Deserialize it to a
Book
object and return theBook
instance from the method.
public async Task<Book> Add(string title, string author, string genre)
{
Book book = new Book() {
Title = title,
Authors = new List<string>(new[] { author }),
ISBN = string.Empty,
Genre = genre,
PublishDate = DateTime.Now.Date,
};
HttpClient client = await GetClient();
var response = await client.PostAsync(Url,
new StringContent(
JsonConvert.SerializeObject(book),
Encoding.UTF8, "application/json"));
return JsonConvert.DeserializeObject<Book>(
await response.Content.ReadAsStringAsync());
}
- Build and run the application. Press the Add button ([+]). When you press the add button, it will add the book and return to the main screen.
Perform a PUT (update) operation
We are now able to display and add new books. Here you add the code necessary to update an existing book.
- Open the
BookManager
class and locate the method namedUpdate
which takes aBook
and returns aTask
. -
In the method implementation, get a new client and use the
PutAsync
method to send a JSON-encoded book to the base URL with the ISBN added to it.- So, if the ISBN is
12345678
, then the URL would beapi/books/12345678
.
- So, if the ISBN is
- You can use the same code to create the message body that you did when adding a book - but in this case we know where to put the book since it already has an assigned ISBN. Make sure to set the encoding and content-type as you did before.
- In this case, we don't have an explicit return type - but we want to return
Task
so that exceptions are properly returned back to the caller, and so the caller can use theawait
keyword to pause the progress of the method until the asynchronous method is finished. - Try out the logic by running the application and tapping on an existing book to edit it.
public async Task Update(Book book)
{
HttpClient client = await GetClient();
await client.PutAsync(Url + "/" + book.ISBN,
new StringContent(
JsonConvert.SerializeObject(book),
Encoding.UTF8, "application/json"));
}
Perform a DELETE operation
The final operation (and easiest) we have is DELETE.
- Open the
BookManager
class and locate theDelete
method which takes a string ISBN and returns aTask
. - In the method body, get a new client and use the
DeleteAsync
method against the base URL + the ISBN (just like the UPDATE case). - Run the application to test the delete logic - you can get to the functionality by swiping to the left on iOS, or by performing a long-click on Android and Windows (press + hold).
public async Task Delete(string isbn)
{
HttpClient client = await GetClient();
await client.DeleteAsync(Url + isbn);
}
Exercise summary
You have successfully utilized a REST service within your Xamarin application. As a fun side exercise, try adding an ActivityIndicator
to the UI while you are loading the books. The completed solution has this code implemented through a Binding
to the Page.IsBusy
property if you'd like to just examine one way to accomplish this.
You can view the completed solution in the Exercise 2 > Completed folder of your copy of the cloned or downloaded course materials.


Things Everyone Should Know About Depression
Facts about depression everyone should be aware of, and some recommendations |
Foreword
This post is a lot to take in, so if you choose to not read it right now, I would recommend you at least watch this 4 minute video:
You can also choose to watch this video version instead of reading:
“In 2017, an estimated 11 million U.S. adults aged 18 or older had at least one major depressive episode with severe impairment. This number represented 4.5% of all U.S. adults. … Approximately 35% of adults with major depressive episode did not receive treatment.”
—National Institude of Mental Health
“Overall, male university students exhibited low overall mental health, limited mental health knowledge, weak mental health beliefs, poor mental health attitudes, high self-stigma to seek help, significant impacts of help-seeking on self-confidence, and low intention to seek professional help. “
—Mental health literacy, stigma, and help-seeking behaviors among male college students
Help starts with understanding. Though false stereotypes about people with depression1 certainly persist, another important issue is that many people just don’t know much about it. If your knowledge about depression amounts to “it’s a mental health thing where you feel terrible, sometimes to the point of being suicidal, and there are a lot pills for it”, you are not equipped to help yourself or others when faced with this disease. And yet, based on the above statistics it’s clear that just about everyone needs to be ready to do just that.
“Based on data collected by the Centers for Disease Control and Prevention in 2007, approximately 25% of adults with mental illness believed that others are sympathetic toward patients diagnosed with these conditions.”
—Evaluation of perceptions and knowledge of mental illness in the United States through crowdsourcing
“Mental health literacy seems to have a promising effect on care seeking. Individuals who better recognize their mental illness and its manifestations, as well as treatment options to address its varied impressions, might better avail themselves of those options (Jorm, 2012).”
—“The Impact of Mental Illness Stigma on Seeking and Participating in Mental Health Care”
There are already many resources aimed at assisting with that, such as “What People With Depression Wish You Knew”, “7 Facts You Should Know About Depression”, and many more. Much of their content is focused on explaning what depression is not with statements such as “Depression Is More Than Ordinary Sadness” and “It’s a real disease”, which is commendable but also results in them not discussing many aspects of what depression is. This is going to be the aim of this piece; more specifically, the intent is to make it easier for anyone to empathize and help others dealing with depression or to face it yourself2. More concretly, I will address the following:
- Foreword
- What Is Depression
- What Causes Depression
- What Is It Like To Have Depression
- How Can You Know You Have Depression
- What To Do If You Think You Have Depression
- Are Antidepressants Necessary to Heal Depression
- How To Help Someone Who Has Depression
If you are having suicidal thoughts, contact the National Suicide Prevention Lifeline at 1-800-273-8255 for support and assistance from a trained counselor. If you or a loved one are in immediate danger, call 911.
For more mental health resources, see our National Helpline Database.
What Is Depression
Clinical depression is a diagnosable health condition with the following diagonostic criteria3:
“Depressed mood and/or loss of interest or pleasure in life activities for at least 2 weeks and at least five of the following symptoms that cause clinically significant impairment in social, work, or other important areas of functioning almost every day:
1.Depressed mood most of the day.
2.Diminished interest or pleasure in all or most activities.
3.Significant unintentional weight loss or gain.
4.Insomnia or sleeping too much.
5.Agitation or psychomotor retardation noticed by others.
6.Fatigue or loss of energy.
7.Feelings of worthlessness or excessive guilt.
8.Diminished ability to think or concentrate, or indecisiveness.
9.Recurrent thoughts of death (APA, 2000, p. 356).”
This period of 2 or more weeks of “depressed mood and/or loss of interest or pleasure in life activities” is known as a major depressive episode, and many people with depression experience more than one such episode in their life:
“Major depressive disorder is one of the most common forms of psychopathology, one that will affect approximately one in six men and one in four women in their lifetimes (Kessler et al., 1994). It is also usually highly recurrent, with at least 50% of those who recover from a first episode of depression having one or more additional episodes in their lifetime, and approximately 80% of those with a history of two episodes having another recurrence (American Psychiatric Association, 2000; Kupfer, Frank, & Wamhoff, 1996; Post, 1992). Once a first episode has occurred, recurrent episodes will usually begin within five years of the initial episode (Belsher & Costello, 1988; Lewinsohn, Clarke, Seeley, & Rohde, 1994), and, on average, individuals with a history of depression will have five (Kessler & Walters, 1998) to nine (Kessler, Zhao, Blazer, & Swartz, 1997) separate depressive episodes in their lifetime.
—Risk for Recurrence in Depression”
Another important thing to note about episodes is their length. Depression is not a temporary mood:
“It is natural to temporarily feel ‘down in the dumps’ from time to time, especially if you are going through an upheaval, loss or stressful situation. Some people refer to this as ‘feeling depressed’. However, if these feelings are intense and persist over weeks or months and if they stop you enjoying or even doing your normal activities, it’s likely that you have depression. Depression is a serious illness that can have a great impact on your everyday life. It’s not something you can normally ‘just snap out of’.”
In fact, this is precisely what makes it so bad; generally, even with treatment it’ll take weeks or months to get better.
What Causes Depression
The science is still unclear on the balance of genetic and environmental causes for depression, so it’s generally correct to understand that it is caused by a combination of the two. According to Genetics Home Reference:
“Depression is known to run in families, suggesting that genetic factors contribute to the risk of developing this disease. However, research into the genetics of depression is in its early stages, and very little is known for certain about the genetic basis of the disease. … Nongenetic (environmental) factors also play critical roles in a person’s risk of developing depression. The disorder can be triggered by substance abuse, certain medications, or stressful life events (such as divorce or the death of a loved one). … It is likely that environmental conditions interact with genetic factors to determine the overall risk of developing this disease.”
It is however important to note that if you have a close relative who had dealt with depression, you are more likely to experience it as well:
“People who have a first-degree relative (for example, a parent or sibling) with depression appear to have a two to three times greater risk of developing the condition than the general public. However, many people who develop depression do not have a family history of the disorder, and many people with an affected relative never develop the disorder.”
It’s also the case that for some people depression is at least partially caused by seasonal changes in weather, and especially lack of sun. Lastly, different occupations and socioeconomic conditions of course have different risk levels for depression:
“Rates for clinical depression in 55 industries ranged from 6.9 to 16.2 %, (population rate = 10.45 %). Industries with the highest rates tended to be those which, on the national level, require frequent or difficult interactions with the public or clients, and have high levels of stress and low levels of physical activity.”
—Prevalence rates for depression by industry: a claims database analysis
“Our results show that graduate students are more than six times as likely to experience depression and anxiety as compared to the general population … 39% of graduate students scored in the moderate to severe depression range in our study, as compared to 6% of the general population measured previously with the same scale “
—Evidence for a mental health crisis in graduate education
What Is It Like To Have Depression
The above definitions are somewhat formal, and I suspect do not help very much with understanding what a person dealing with it is going through. Speaking less formally, there are at least three parts of the subjective experience of depression one needs to understand:
- Emotional: Your baseline enjoyment of life decreases. In other words, you start constantly feeling a sense of suffering, or emotional pain, for no clear reason.
- Physical4: You have less energy. Just about anything feels like a tiresome undertaking, and you often feel like just lying down and doing nothing. It may seem impossible to do the smallest of tasks5.
- Mental: Your thinking becomes distorted and negative.  Thinking and concentraing becomes harder, as if trying to see something through a fog. It’s hard to imagine things becoming better, or to form a positive idea of the future in general. You have a variety of intrusive negative thoughts, which at the worst often deal with self harm of even suicide; these thoughts can happen regardless of however much you believe or agree with their content.
This is still somewhat abstract and hard to empathize with, so to further understand this condition I recommend listening to this song:
So, as you can imagine it’s a difficult and highly painful condition to be in. The above is what you really need to understand, though it only starts to describe it.
How Can You Know You Have Depression
One of the tricky aspects of depression is that the above stated symptoms can often happen to varying degress as part of normal life, without reflecting a mental health condition. So how do you know whether you are going through a rough patch, or are dealing with depression?
The obvious answer is that you should consult a mental health professional, if you think depression is a possibility. But that’s also not an easy thing to do. So, an easy alternative is to start with a a short multiple choice quiz, which can inform you on whether it is time to seek professional help. There are also many apps that serve a similar purpose.
What To Do If You Think You Have Depression
These are my personal and subjective recommendations on things to keep in mind and do if you think you may be dealing with depression.
First, try to understand that however bad things may seem, your perception of how bad things are is distorted by this condition, and objectively things are probably not as bad as they seem. One thing I found helpful was to think of there being two of me - the “depressed Andrey” and the “healthy Andrey”, with the former thinking quite unlike the latter; it was important to remember that what I considered my true self, with the beliefs I agreed with, was the healthy Andrey. Keeping that in mind may not make you feel better, but it’ll make it easier to motivate yourself to take the following steps to get better.
Second, do your best to continue living your life as before. Keep waking up, showering, going outside, seeing friends, excercising, etc (to the extent that you can; do not feel guilty about things you cannot do). The more you keep moving, keep believing if you put in the work things will get better, the less painful it will all be. It may not be easy, but the important thing is to not give up, and to keep making the effort. One thing that helped me is an unwavering belief in “this too shall pass”; if you truly believe the above facts about depression, you should also believe that it will pass with treatment, so it’s only a matter of time and perseverance.
Third, try to reach out for help. First and foremost, try and confide in your close friends and family, who can help you in this difficulty time. If it is an option, a therapist, or at least a support group, is an ideal first option to help you cope with this. Depending on their recommendation, you may also want to see a psychiatrist and consider taking antidepressants. Although you may be uncomfortable with this course of action, you really ought to go through with it:
“Up to 80% of those treated for depression show an improvement in their symptoms generally within four to six weeks of beginning medication, psychotherapy, attending support groups or a combination of these treatments. (National Institute of Health, 1998). Despite its high treatment success rate, nearly two out of three people suffering with depression do not actively seek nor receive proper treatment. (DBSA, 1996)”.
Fourth, if there are external/environmental causes for your depression, do your best to remove them. For instance, if you are stressed by work, try and put it on pause. This too is likely not easy, but if it is doable it is definitely beneficial. At the very least, it’s a good idea to have things to look forward to, such as a vacation or a trip to be with family.
Fifth, if things are getting really bad and seem to just be getting worse, be cautious with making life altering decisions at this time. As described above, your thinking and by extension your decision making becomes distorted and therefore unreliable. I personally almost called off applying for PhD programs while depressed, and am very glad in hindsight that I did not. One thing that helps is to try and remember this notion of the “healthy you”, and what that version of you would think of this course of action. Consulting with others is a great idea, as well.
Needless to say, this especially applies to any thoughts of self harm; if things are getting to the point of getting concerning, try and make ahead of time what you’ll do when in a really tough place to survive it, such as calling the National Suicide Prevention Lifeline. One thing I found helpful was to just promise to myself that no matter how things got, no matter how many thoughts about it I had, I would not really consider or attempt suicide; to be honest, you may think about it a lot, but knowing that these are just thoughts and you don’t truly consider that an option makes them more bearable.
Are Antidepressants Necessary to Heal Depression
It’s easy to feel uncomfortable about the idea of antidepressants, but the fact is that they are often an effective treatment for depression:
“The various antidepressants have been compared in many studies. Overall, the commonly used tricyclic antidepressants SSRIs and SSNRIs performed equally well. Studies of adults with moderate or severe depression showed:
Without antidepressants: About 20 to 40 out of 100 people who took a placebo noticed an improvement in their symptoms within six to eight weeks.
With antidepressants: About 40 to 60 out of 100 people who took an antidepressant noticed an improvement in their symptoms within six to eight weeks.”
—Depression: How effective are antidepressants?
“All antidepressants were more efficacious than placebo in adults with major depressive disorder. … Our literature search was as comprehensive as possible, including the largest amount of unpublished data to date, which are associated with less favourable effect sizes for antidepressants.”
—Comparative efficacy and acceptability of 21 antidepressant drugs for the acute treatment of adults with major depressive disorder: a systematic review and network meta-analysis
However, they are not the solution for everyone: “But a report recently published in The Journal of the American Medical Association showed that the drugs work best for very severe cases of depression and have little or no benefit over placebo (inactive pills) in less serious cases.” Certainly mild to moderate depression can be healed without medication, and in fact that has worked for me in the past, but in a severe case such as mine it should really be considered. This is really a case where talking to a therapist or psychiatrist is ideal, to understand your needs.
Antidepressants do have side effects, and some people struggle with finding the right medication for them. In my case, my psychiatrist asked me to ask my relatives what worked for them, and that indeed proved very effective for me (after months of excercise, therapy, talking to friends, and other measures did not improve my condition). So to conclude, while they are not necessary, antidepressants are an important option that should be considered with the consultation of a mental health professional for serious cases of depression.
Antidepressants are not meant to make you happy (they are not ‘happy pills’), so much as to heal you of depression and just make you normal. In my case, I did have a brief period of time after starting on them in which I was unusually cheerful and energetic, but this soon subsided and I just started to feel like my regular self. One thing to know is that you will need to continue taking them for some time after your depression improves, and it may take a process of gradual reduction to be able to stop. In my case this slight lack of freedom has certainly been worth it, but it is something you should be aware of.
How To Help Someone Who Has Depression
This one is tough, but boils down to the same one always needs to do to help someone: have compassion, care for them, and just be there. Beyond that, many lists out there provide good further recommendations. One thing I will personally emphasize is that you should try and be direct about asking if someone is doing well. If they seem to be having many of the symptoms of depression, don’t hesitate to follow up a simple “how are you doing lately” with “are you sure things are alright? it’s just that you seem more down than usual lately”, or the like.
Feedback If you think there are other essential bits of information I should add to this, or have other feedback, feel free to reach out to me at my email andreyvkurenkov at gmail dot com .
-
When I write “depression” in this post I refer to major depressive disorder, also known as clinical depression ↩
-
I will do this through a mix of summarizing what is objectively known about depression and sharing my own personal experience with it. Disclaimer: I am not a mental health professional or doctor, and write this only as someone who has dealt with depression and educated myself about it. What I share about my own experience will of course not be universal, but will still hopefully be helpful. ↩
-
This is according to the Diagnostic and Statistical Manual of Mental Disorders, which has historically had some flaws, but in this case provides a sensible definition. ↩
-
These are of course partially mental, so I mean physical here in the sense of dealing with physical movement or sensing. ↩
-
This is sometimes conveyed with the spoon metaphor, which involves imagining us all as having a limited discrete quantity of ‘energy units’ every day, which one can think of as spoons, and understanding that those with mental illness have fewer of these each day and so can do less. ↩


--- layout: post title: June-July 2020 Cohort subtitle: "Laying the Foundation" date: 2020-07-10 11:06:13 +0700 background: '/img/posts/01.jpg' ---
In June 2020, we started our second Jesus Prayer 40 cohort. This group helped to further flesh out what JP40 pilgrims were looking for and helped us to build up the necessary resources to help them.
Over the course of these six weeks, we had a series of fantastic discussions, whether in the Facebook group or during our Zoom calls. Our pilgrims from across Canada, the US, and even Thailand thoroughly enjoyed learning about and developing a deeper devotion to the Prayer of the Heart.


class NaCl::Signatures::Ed25519::SigningKey
- NaCl::Signatures::Ed25519::SigningKey
- Reference
- Object
Overview
Private key for producing digital signatures using the Ed25519 algorithm. Ed25519 provides a 128-bit security level, that is to say, all known attacks take at least 2^128 operations, providing the same security level as AES-128, NIST P-256, and RSA-3072.
Signing keys are produced from a 32-byte (256-bit) random seed value. This value can be passed into the SigningKey constructor as a String whose bytesize is 32.
The public VerifyKey can be computed from the private 32-byte seed value as well, eliminating the need to store a "keypair".
SigningKey produces 64-byte (512-bit) signatures. The signatures are deterministic: signing the same message will always produce the same signature. This prevents "entropy failure" seen in other signature algorithms like DSA and ECDSA, where poor random number generators can leak enough information to recover the private key.
Included Modules
Defined in:
nacl/signatures/ed25519/signing_key.crConstructors
-
.new(seed)
Create a SigningKey from a seed value
Class Method Summary
-
.generate
Generate a random SigningKey
Instance Method Summary
-
#bytes : Slice(UInt8)
Return the raw seed value of this key
-
#keypair_bytes : Slice(UInt8)
Return the raw 64 byte value of this key
-
#sign(message)
Sign a message using this key
-
#signature_bytes
The size of signatures generated by the SigningKey instance
- #verify_key : VerifyKey


Grab coffee n snacks
Bytes
You have 0 coffee n snacks
Gives you 0 bytes/s
Ask friends to help
Bytes
You have 0 friends to help
Gives you 0 bytes/s
Searching on StuckOverFlood
Bytes
You have asked 0 questions
Gives you 0 bytes/s
Attract sponsor
Write a website
Bytes
You have 0 written sites
Gives you 0 bytes/s
Write a script
Bytes
You have 0 written scripts
Gives you 0 bytes/s


We're sorry but project doesn't work properly without JavaScript enabled. Please enable it to continue.


Technology is very rapidly developing
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Diposting pada December 8, 2020
Technology is very rapidly developing
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Diposting pada December 8, 2020
Technology is very rapidly developing
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Diposting pada December 8, 2020
Technology is very rapidly developing
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Diposting pada December 8, 2020
Technology is very rapidly developing
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Diposting pada December 8, 2020


| Time | Activity |
|---|---|
| 09:00 AM - 10:30 AM | Class |
| 10:30 AM - 11:00 AM | Morning break |
| 11:00 AM - 12:30 PM | Class |
| 12:30 PM - 01:30 PM | Lunch break |
| 01:30 PM - 03:00 PM | Class |
| 03:00 PM - 03:30 PM | Afternoon break |
| 03:30 PM - 05:00 PM | Class |
Every time someone logs onto a system by hand, they jeopardize everyone's understanding of the system. – Mark Burgess
As of Feb 2020:
A good track record.
Known to run on many platforms, and interesting places.
Focus on the desired end state
bundle agent main | #!/bin/env/bash { | PKG="openssh-server" packages: | rpm -q ${PKG} || yum install ${PKG} "openssh-server" | yum check-update openssh-server policy => "present", | if [ $? -eq 100 ]; then version => "latest"; | yum upgrade openssh-server } | fi
wget -O- http://cfengine.package-repos.s3.amazonaws.com/\
quickinstall/quick-install-cfengine-community.sh | sudo bash
wget http://cfengine.package-repos.s3.amazonaws.com/quickinstall/\
quick-install-cfengine-enterprise.sh
sudo bash ./quick-install-cfengine-enterprise.sh <hub|agent>
cf-hub
common control
" and "hub control
" bodiescf-runagent
--define
)--remote-bundles
)cf-serverd
cf-runagent
requestscf-hub
common
" and "server
" bundlesserver control
"cf-key
cf-promises
cf-promises --syntax-description
cf-promises --tag-release
)cf-promises --show-vars --show-classes
cf-monitord
mon.*
variablescommon
" and "monitor
" bundlescommon control
" and "monitor control
" bodiescf-execd
cf-agent
periodicallycommon
" bundlesexecutor control
" bodycf-agent
agent
" and "common
" bundlescommon control
" and "agent control
" bodies.$(sys.default_policy_path)
/var/cfengine/inputs/promises.cf
~/.cfagent/inputs/promises.cf
The default "Masterfiles"
promises.cf
update.cf
standalone_self_upgrade.cf
lib/*
cfe_internal/*
controls/*
inventory/*
templates/*
def.json
(Augments)services/*.cf
services/main.cf
services/autorun/*.cf
CUSTOM_DIRECTORY/*.cf
A model of voluntary cooperation between individual autonomous actors.
kept
repaired
not_kept
failed
denied
timeout
Note: Compound promises can have multiple outcomes at the same time (not_kept & kept & repaired).
files: "/mnt/volume/file.txt" create => "true", perms => m( 777 ), edit_line => lines_present( "Hello World $(sys.date)" ), edit_defaults => empty;
access, build_xpath, classes, commands, databases, defaults, delete_attribute, delete_lines, delete_text, delete_tree, field_edits, files, guest_environments, insert_lines, insert_text, insert_tree, measurements, meta, methods, packages, processes, replace_patterns, reports, roles, services, set_attribute, set_text, storage, users, vars
bundle type name { promise_type: context:: "promiser" -> { "optional", "stakeholder" } attribute_1 => value_1, attribute_2 => value_2, meta => { "tag1", "tag2", "tag3=something" }, comment => "Why important"; } body attribute_N name(optional) { context:: attribute_N_1 => "value"; attribute_N_2 => { "value" }; }
bundle agent main { methods: "" usebundle => set_item_in_bag( "hammer", "slightly damaged"); "" usebundle => set_item_in_bag( "pickaxe", "perfect"); "" usebundle => set_item_in_bag( "flask", "half full"); "" usebundle => report_bag_contents; reports: "$(with)" with => join( ", ", getindices( "set_item_in_bag.array" ) ); } bundle agent set_item_in_bag(item, value) { vars: "$(item)" string => "$(value)"; "array[$(item)]" string => "$(value)"; } bundle agent report_bag_contents { vars: "l" slist => variablesmatching("default:set_item_in_bag\..*"); "a[$(l)]" string => nth( string_split( "$(l)", "\.", 2 ), 1); reports:"You look in the bag and see ...."; "A $($(l)) $(a[$(l)])"; }
R: You look in the bag and see .... R: A slightly damaged hammer R: A perfect pickaxe R: A half full array[flask] R: A half full flask R: flask
For example, a bundle to configure Apache might:
apache2
packagecf-promises --syntax-description json | jq '.bundleTypes | keys[]'
main
is the default__main__
is treated as main if in $(sys.policy_entry_filename)
bundle agent inventory_things { vars: "thing" string => readfile( "/tmp/thing", inf ), meta => { "inventory", "attribute_name=Inventoried Thing" }; } bundle agent __main__ { methods: "inventory_things"; }
classes
, perms
, copy_from
)There are 41 body types as of 3.15.0
cf-promises --syntax-description json | jq '.bodyTypes | keys |join(", ") '
acl, action, agent, changes, classes, common, contain, copy_from, database_server, delete, delete_select, depth_search, edit_defaults, edit_field, environment_interface, environment_resources, executor, file, file_select, hub, insert_select, link_from, location, match_value, monitor, mount, package_method, package_module, password, perms, printfile, process_count, process_select, rename, replace_with, report_data_select, runagent, select_region, server, service_method, volume
bundle agent main { files: "/tmp/show_default_action" create => "true"; "/tmp/show_explicit_action" create => "true", action => fix; } body action fix { action_policy => "fix"; } body file control { namespace => "bodydefault"; } body action files_action { action_policy => "warn"; }
warning: Warning promised, need to create file '/tmp/show_default_action' info: Created file '/tmp/show_explicit_action', mode 0600
bundle agent illustrating_normal_order { vars: "color1" string => "red"; reports: "$(color1)+$(color2) = Purple"; vars: "color2" string => "blue"; }
# cf-agent --bundlesequence illustrating_normal_order --no-lock --log-level info --file illustrating_normal_oder.cf info: Using command line specified bundlesequence R: red+blue = Purple
bundle agent illustrating_normal_order { vars: "color1" string => "red"; "color2" string => "blue"; reports: "$(color1)+$(color2) = Purple"; }
# cf-agent --bundlesequence illustrating_normal_order --no-lock --log-level info --file illustrating_normal_oder2.cf info: Using command line specified bundlesequence R: red+blue = Purple
def.json
)def.json
is found next to $(sys.policy_entry_filename)
def
bundle scope{ "classes": { "by_regular_expression": [ "ubuntu_\\d+" ], "by_class_expression": [ "(Afternoon|Evening).(Monday|Wednesday|Friday)::" ], }, "vars": { "myvar1": "defined from augments", "myvar2": "defined from augments" } }
bundle agent main { reports: "I defined '$(const.dollar)(def.myvar1)' as '$(def.myvar1)'"; by_regular_expression:: "Define classes from augments based on a regular expression"; by_class_expression:: "Define classes from augments based on CFEngine class expressions"; }
cf-agent --no-lock --file ./examples/augments/augments.cf
R: I defined '$(def.myvar1)' as 'defined from augments' R: Define classes from augments based on a regular expression R: Define classes from augments based on CFEngine class expressions
bundle common def { vars: "myvar1" string => "Defined in policy"; "myvar2" string => "Defined in policy", if => not( isvariable( myvar2 ) ); } bundle agent main { reports: "I defined '$(const.dollar)(def.myvar1)' as '$(def.myvar1)'"; "I defined '$(const.dollar)(def.myvar2)' as '$(def.myvar2)'"; by_regular_expression:: "Define classes from augments based on a regular expression"; by_class_expression:: "Define classes from augments based on CFEngine class expressions"; }
cf-agent --no-lock --file ./examples/augments/augments-policy-wins.cf
R: I defined '$(def.myvar1)' as 'Defined in policy' R: I defined '$(def.myvar2)' as 'defined from augments' R: Define classes from augments based on a regular expression R: Define classes from augments based on CFEngine class expressions
Merge more augments on top.
{ "vars": { "myvar1": "defined from augments for all", "myvar2": "defined from augments for all" }, "augments": [ "$(sys.policy_entry_dirname)/$(sys.os).json" ] }
{ "vars": { "myvar2": "override for linux hosts" } }
bundle agent main { reports: "'$(const.dollar)(def.myvar1)' is '$(def.myvar1)'"; "'$(const.dollar)(def.myvar2)' is '$(def.myvar2)'"; }
cf-agent --no-lock --file ./examples/augments-multiple/promises.cf
R: '$(def.myvar1)' is 'defined from augments for all' R: '$(def.myvar2)' is 'override for linux hosts'
bundle agent example_macro_minimum_version { @if minimum_version(4.0.0) This contains completely invalid syntax, but it's OK. Only versions 4 and greater will evaluate this section. @endif @if minimum_version(3.14.0) # the function `classfiltercsv()` was introduced in 3.14.0 vars: "container" data => classfiltercsv( $(file), # File true, # Has header 0, # Class column 2); # Optional sort column @endif }
You can conditionally parse policy based on compiled in features using this macro.
bundle agent main { @if feature(yaml) # the yaml library may not be compiled in vars: "container" data => parseyaml(' - array1 - array2 - key: 1 - key: 2'); @endif reports: "$(with)" with => string_mustache('{{%-top-}}', container ); }
There are 171 functions as of 3.15.0
accessedbefore, accumulated, ago, and, basename, bundlesmatching, bundlestate, callstack_callers, callstack_promisers, canonify, canonifyuniquely, changedbefore, classesmatching, classfiltercsv, classify, classmatch, concat, countclassesmatching, countlinesmatching, data_expand, data_readstringarray, data_readstringarrayidx, data_regextract, data_sysctlvalues, datastate, difference, dirname, diskfree, escape, eval, every, execresult, expandrange,
file_hash, fileexists, filesexist, filesize, filestat, filter, findfiles, findprocesses, format, getclassmetatags, getenv, getfields, getgid, getindices, getuid, getuserinfo, getusers, getvalues, getvariablemetatags, grep, groupexists, hash, hash_to_int, hashmatch, host2ip, hostinnetgroup, hostrange, hostsseen, hostswithclass, hubknowledge, ifelse, intersection, ip2host, iprange, irange, isdir, isexecutable, isgreaterthan, isipinsubnet, islessthan, islink, isnewerthan, isplain, isvariable,
join, lastnode, laterthan, ldaparray, ldaplist, ldapvalue, length, lsdir, makerule, maparray, mapdata, maplist, max, mean, mergedata, min, network_connections, none, not, now, nth, on, or, packagesmatching, packageupdatesmatching, parseintarray, parsejson, parserealarray, parsestringarray, parsestringarrayidx, parseyaml, peerleader, peerleaders, peers, processexists, product, randomint, read_module_protocol, readcsv, readdata, readenvfile,
readfile, readintarray, readintlist, readjson, readrealarray, readreallist, readstringarray, readstringarrayidx, readstringlist, readtcp, readyaml, regarray, regcmp, regex_replace, regextract, registryvalue, regldap, regline, reglist, remoteclassesmatching, remotescalar, returnszero, reverse, rrange, selectservers, shuffle, some, sort, splayclass, splitstring, storejson, strcmp, strftime, string_downcase, string_head, string_length, string_mustache, string_replace, string_reverse, string_split, string_tail, string_upcase, sublist, sum, sysctlvalue, translatepath, unique, url_get, usemodule, userexists, variablesmatching, variablesmatching_as_data, variance
cf-promises --show-classes
cf-agent --show-evaluated-classes
vars: "defined" slist => classesmatching( ".*" );
cf-promises --show-classes | tail -n+2 | awk -vORS=", " '{print $1}'
127_0_0_1, 172_17_0_1, 192_168_122_1, 192_168_42_189, 4_cpus, 64_bit, Afternoon, Day23, February, GMT_Day23, GMT_Evening, GMT_February, GMT_Hr18, GMT_Hr18_Q3, GMT_Lcycle_1, GMT_Min30_35, GMT_Min34, GMT_Q3, GMT_Sunday, GMT_Yr2020, Hr12, Hr12_Q3, Lcycle_1, Min30_35, Min34, PK_SHA_43c979e264924d0b4a2d3b568d71ab8c768ef63487670f2c51cd85e8cec63834, Q3, Sunday, Yr2020, any, cfengine, cfengine_3, cfengine_3_15, cfengine_3_15_0, common, compiled_on_linux_gnu, debian, debian_buster, enterprise, enterprise_3, enterprise_3_15, enterprise_3_15_0, enterprise_edition,
fe80__5ee0_c5ff_fe9f_f38f, feature, feature_curl, feature_def, feature_def_json, feature_def_json_preparse, feature_tls, feature_tls_1, feature_tls_1_0, feature_tls_1_1, feature_tls_1_2, feature_tls_1_3, feature_xml, feature_yaml, ipv4_127, ipv4_127_0, ipv4_127_0_0, ipv4_127_0_0_1, ipv4_172, ipv4_172_17, ipv4_172_17_0, ipv4_172_17_0_1, ipv4_192, ipv4_192_168, ipv4_192_168_122, ipv4_192_168_122_1, ipv4_192_168_42, ipv4_192_168_42_189, ipv4_gw_192_168_42_1, ipv6_fe80__5ee0_c5ff_fe9f_f38f, linux, linux_5_0_0_38_lowlatency, linux_x86_64, linux_x86_64_5_0_0_38_lowlatency, linux_x86_64_5_0_0_38_lowlatency__41_Ubuntu_SMP_PREEMPT_Tue_Dec_3_01_06_41_UTC_2019,
mac_02_42_fb_b7_c0_59, mac_52_54_00_6b_62_06, mac_5c_e0_c5_9f_f3_8f, my_other_example, net_iface_docker0, net_iface_lo, net_iface_virbr0, net_iface_wlan0, nickanderson_thinkpad_w550s, nova, nova_3, nova_3_15, nova_3_15_0, nova_edition, systemd, test_class_29665402e2b4331f10b8d767b512cd916eeb5db9, test_class_29665402e2b4331f10b8d767b512cd916eeb5db9_2, ubuntu, ubuntu_19, ubuntu_19_04, x86_64,
| . (dot) | AND |
| & (ampersand) | AND |
| l (pipe) | OR |
| ! (exclamation) | NOT |
| () (parenthesis) | grouping |
.
than &
to express ANDbundle agent main { files: linux.(Sunday|Saturday):: "/etc/nologin" -> { "Human Resources" } create => "true", comment => "Disallow non-root logins on the weekend. We believe in work-life balance, and encourage it."; linux.!(Sunday|Saturday):: "/etc/nologin" -> { "Business Operations" } delete => tidy, comment => "People need to be able to log in for them to do their work during the week"; }
redhat
, Thursday
, linux
[a-zA-Z0-9_]
_
.Note: Classes are NOT automatically canonified when checked.
bundle agent main { vars: "my_class_name" string => "Invalid-Class/Name!"; "c_my_class_name" string => canonify( "$(my_class_name)" ); classes: "$(my_class_name)" expression => "any"; reports: "'$(my_class_name)' is **NOT** a class that is defined" unless => "$(my_class_name)"; "'$(c_my_class_name)' **IS** a defined class" if => canonify( $(my_class_name) ); }
R: 'Invalid-Class/Name!' is **NOT** a class that is defined R: 'Invalid_Class_Name_' **IS** a defined class
| Bundle Type | Scope |
common |
namespace |
agent |
bundle |
classes
bodies default to namespace scope
Pro Tip: Use bundle
scoped classes whenever possible.
bundle agent main { classes: "weekend" or => { "Saturday", "Sunday" }; "weekday" not => "weekend"; "business_hours" expression => "weekday.(Hr9|Hr10|Hr11|Hr13|Hr14|Hr15|Hr16|Hr17)", comment => "Weekdays from 9-5 excluding the lunch hour."; "webserver" expression => regcmp( "www.*", $(sys.fqhost) ), comment => "Identify webservers based on their name"; "north_america" expression => iprange( "<IP_ADDRESS>/16" ); }
bundle agent main { vars: "config[PermitRootLogin]" string => "no"; files: "/etc/ssh/sshd_config" edit_line => set_line_based("$(this.bundle).config", # Config MAP " ", # Separator "\s+", # Separator regex ".*", # Keys to consider "\s*#\s*"), # Lines to ignore classes => scoped_classes_generic("bundle", "sshd_config"); services: sshd_config_repaired:: "sshd" service_policy => "restart", comment => "For sshd to pick up changed config it must be restarted." }
bundle agent main { reports: "Hello World!"; linux.!(Saturday|Sunday):: "This is a linux host."; "Today is not Saturday or Sunday."; }
R: Hello World! R: This is a linux host. R: Today is not Saturday or Sunday.
bundle agent main { vars: "platforms" slist => { "linux", "windows" }; reports: "I am a $(platforms) host" if => "$(platforms)"; # ifvarclass => "$(platforms)"; "I was made by Microsoft" unless => "!windows"; }
R: I am a linux host
bundle agent main { vars: "platforms" slist => { "linux", "windows" }; reports: !(Saturday|Sunday):: "It's a weekday and I am a $(platforms) host!" if => "$(platforms)"; "$(platforms)":: "I am a $(platforms) host and it's a weekday!" if => "!(Saturday|Sunday)"; }
R: It's a weekday and I am a linux host! R: I am a linux host and it's a weekday!
cf-promises --syntax-description json | jq '.functions | \ with_entries( select(.value.returnType == "context") ) | \ keys | join( ", ")'
accessedbefore, changedbefore, classify, classmatch, every, fileexists, filesexist, groupexists, hashmatch, hostinnetgroup, hostrange, iprange, isdir, isexecutable, isgreaterthan, isipinsubnet, islessthan, islink, isnewerthan, isplain, isvariable, laterthan, ldaparray, none, processexists, read_module_protocol, regarray, regcmp, regextract, regldap, regline, reglist, remoteclassesmatching, returnszero, some, splayclass, strcmp, usemodule, userexists
$(variable)
, @(list or data container)
$(bundle.variable)
, @(bundle.list)
$(namespace:bundle.variable)
, @(namespace:bundle.list)
bundle agent main { vars: "string1" string => "one"; "string2" string => "strings can be multi-line"; "string3" string => "with \"quotes\""; "string4" string => 'or "quotes"'; "string5" string => `with 'single' and "double" quotes`; reports: "string1 = '$(string1)'"; "string2 = '$(string2)'"; "string3 = '$(string3)'"; "string4 = '$(string4)'"; "string5 = '$(string5)'"; }
R: string1 = 'one' R: string2 = 'strings can be multi-line' R: string3 = 'with "quotes"' R: string4 = 'or "quotes"' R: string5 = 'with 'single' and "double" quotes'
bundle agent main { vars: "var1" int => "1"; "var2" int => "10K"; "var3" real => "1.2"; "var4" real => "10e-5"; "var5" int => "inf"; reports: "var1 = '$(var1)'"; "var2 = '$(var2)'"; "var3 = '$(var3)'"; "var4 = '$(var4)'"; "inf = '$(var5)'"; }
R: var1 = '1' R: var2 = '10240' R: var3 = '1.200000' R: var4 = '0.000100' R: inf = '999999999'
bundle agent main { vars: "var1" ilist => { 1, 2, "3", "4" }; "var2" rlist => { "1.2", "2.0", "3.3" }; "var3" slist => { "one", "two", three, @(var1), @(var2), }; "var4" real => sum( var2 ); reports: "var1 = '$(var1)'"; "var2 = '$(var2)'"; "var3 = '$(var3)'"; "var4 = '$(var4)'"; }
R: var1 = '1' R: var1 = '2' R: var1 = '3' R: var1 = '4' R: var2 = '1.2' R: var2 = '2.0' R: var2 = '3.3' R: var3 = 'one' R: var3 = 'two' R: var3 = 'three' R: var3 = '1' R: var3 = '2' R: var3 = '3' R: var3 = '4' R: var3 = '1.2' R: var3 = '2.0' R: var3 = '3.3' R: var4 = '6.500000'
bundle agent main { vars: "numbers" slist => { "1", "2", "3" }; "colors" slist => { "red", "green", "blue" }; reports: "$(numbers)"; "$(colors)"; "$(numbers) with $(colors)"; "$(colors) with $(numbers)"; }
R: 1 R: 2 R: 3 R: red R: green R: blue R: 1 with red R: 1 with green R: 1 with blue R: 2 with red R: 2 with green R: 2 with blue R: 3 with red R: 3 with green R: 3 with blue R: red with 1 R: red with 2 R: red with 3 R: green with 1 R: green with 2 R: green with 3 R: blue with 1 R: blue with 2 R: blue with 3
bundle agent main { vars: "file[motd]" string => "/etc/motd"; "file[fstab]" string => "/etc/fstab"; "file_idx" slist => getindices( file ); "files" slist => getvalues( file ); reports: "The key '$(file_idx)' has the value '$(file[$(file_idx)])'"; "file: '$(files)'"; }
R: The key 'motd' has the value '/etc/motd' R: The key 'fstab' has the value '/etc/fstab' R: file: '/etc/motd' R: file: '/etc/fstab'
bundle agent main { vars: "server" string => "mirror.int.cfengine.com"; "repos" data => parsejson('{ "rhel6_updates": { "id": { "value":"RHEL6_UPDATES" }, "name": { "value": "RHEL 6.x Updates" }, "baseurl": { "value": "https://$(server)/RHEL6/updates" } } }'); "idx" slist => getindices( repos ); reports: "URL = '$(repos[$(idx)][baseurl][value])'"; }
R: URL = 'https://mirror.int.cfengine.com/RHEL6/updates'
bundle agent main { vars: "ClassicArray[key]" string => "value"; "ClassicArray[deep]" slist => { "list" }; "DataContainer" data => '{ "key": "value", "deep": [ "list" ] }'; reports: "ClassicArray:$(with)" with => string_mustache( "{{%-top-}}", ClassicArray); "DataContainer:$(with)" with => string_mustache( "{{%-top-}}", DataContainer); }
R: ClassicArray:{ "deep": [ "list" ], "key": "value" } R: DataContainer:{ "deep": [ "list" ], "key": "value" }
[root@hub masterfiles]# cat > def.json <<EOF { "classes": { "cfengine_internal_masterfiles_update": [ "policy_server" ], "services_autorun": [ "any" ] } } EOF
Copy this example to services/autorun/nologin.cf
bundle agent nologin { files: "/tmp/nologin" create => "true", classes => results("bundle", "my_file"); reports: my_file_repaired:: "File repaired"; any:: "File Exists" if => fileexists("/tmp/nologin"); }
R: File repaired R: File Exists
bundle agent main { meta: "tags" slist => { "autorun" }; files: "$(sys.statedir)/$(this.bundle)" -> { "Monitoring" } create => "true", touch => "true", classes => scoped_classes_generic("bundle", "heartbeat"), handle => "cf_agent_heartbeat_thump", comment => "This policy simply updates the timestamp of the file so an external monitoring system can validate the system is working."; reports: DEBUG|DEBUG_cf_agent_heartbeat:: "DEBUG $(this.bundle): Heartbeat" if => "heartbeat_repaired"; "DEBUG $(this.bundle): Flatline" unless => "heartbeat_repaired"; }
R: DEBUG main: Heartbeat
bundle agent main { vars: "config[driftfile]" string => "/var/lib/ntp/drift"; packages: "ntp" policy => "present"; services: "ntpd" service_policy => "start"; "ntpd" service_policy => "restart", if => "ntpd_conf_repaired"; files: "/etc/ntp.conf" edit_line => set_line_based("$(this.bundle).config", # Key Values " ", # Separator "\s+", # Separator regex ".*", # Keys to use "\s*#\s*"), # Ignore lines classes => results("bundle", "httpd_conf"); }
bundle common classes_role_by_hostname { classes: "env_prod" meta => { "inventory", "attribute_name=Role Classes" }; or => { regcmp( "hub", $(sys.fqhost) ), regcmp( "^prd.*", $(sys.fqhost) ), }; "webserver" expression => "host001", meta => { "inventory", "attribute_name=Role Classes" }; "webserver" expression => regcmp( "^www.*", $(sys.fqhost) ), meta => { "inventory", "attribute_name=Role Classes" }; }
bundle common classify_geo_location_by_network { meta: "tags" slist => { "autorun" }; vars: "nadc01_subnets" slist => { "<IP_ADDRESS>/25", "<IP_ADDRESS>/16", "<IP_ADDRESS>/32", }; "nadc02_subnets" slist => { "<IP_ADDRESS>/25", "<IP_ADDRESS>/16", "<IP_ADDRESS>/32", }; "sadc01_subnets" slist => { "<IP_ADDRESS>/23", "<IP_ADDRESS>-5" }; "continent" string => ifelse("north_america", "North America", "south_america", "South America", "Unknown"), meta => { "inventory", "attribute_name=Continent" };
classes: "north_america" or => { "nadc01", "nadc02" }; "south_america" expression => classmatch("^sadc\d+"); "nadc01" expression => iprange( $(nadc01_subnets) ); "nadc02" expression => iprange( $(nadc02_subnets) ); "sadc01" expression => iprange( $(sadc01_subnets) ); reports: "DEBUG|DEBUG_$(this.bundle)":: "DEBUG $(this.bundle): Continent = '$(continent)'"; }
bundle agent manage_ssh { meta: "tags" slist => { "autorun" }; methods: "SSH Config Data" usebundle => ssh_config; "Manage SSH Config" usebundle => ssh_config_manage_kv("ssh_config.data"); }
bundle agent ssh_config { vars: "data[PermitRootLogin]" string => "no"; "data[Protocol]" string => "2"; "data[Port]" string => "22"; DEBUG|DEBUG_ssh_config:: "keys" slist => getindices(data); reports: DEBUG|DEBUG_ssh_config:: "DEBUG $(this.bundle): $(keys) = '$(data[$(keys)])'"; }
bundle agent ssh_config_manage_kv(data) { vars: "config" string => "/etc/ssh/sshd_config"; files: "$(config)" handle => "ssh_config_manage_kv_entries", edit_line => set_line_based("$(data)", " ", "\s+", ".*", "\s*#\s*"), classes => scoped_classes_generic("bundle", "sshd_config"); classes: sshd_config_repaired:: "config_valid" expression => returnszero("/usr/sbin/sshd -t -f $(config)", noshell), comment => "It's important that we don't restart the service with a broken config, or the service will be down."; commands: sshd_config_repaired.config_valid:: "$(paths.service)" handle => "ssh_config_manage_kv_restart_after_config_change", args => "sshd restart", comment => "The service must be restarted in order to pick up new configuration settings."; reports: "DEBUG $(this.bundle): Reparied configuration" if => "sshd_config_repaired"; "DEBUG $(this.bundle): Configuration Valid" if => "config_valid"; "DEBUG $(this.bundle): Restarted sshd after config change" depends_on => { "ssh_config_manage_kv_restart_after_config_change" }; }
[root@hub masterfiles]# cf-agent -KID DEBUG_ssh_config,DEBUG_ssh_config_manage_kv info: Installing cfe_internal_non_existing_package... R: DEBUG ssh_config: PermitRootLogin = 'no' R: DEBUG ssh_config: Protocol = '2' R: DEBUG ssh_config: Port = '22' info: Edit file '/etc/ssh/sshd_config' R: DEBUG ssh_config_manage_kv: Reparied configuration info: Executing 'no timeout' ... '/sbin/service sshd restart' notice: Q: "...in/service sshd": Stopping sshd: [ OK ] Q: "...in/service sshd": Starting sshd: [ OK ] info: Last 2 quoted lines were generated by promiser '/sbin/service sshd restart' info: Completed execution of '/sbin/service sshd restart' R: DEBUG ssh_config_manage_kv: Configuration Valid R: DEBUG ssh_config_manage_kv: Restarted sshd after config change
bundle agent motd { meta: "tags" slist => { "autorun" }; vars: "owner" string => "Bruce Wayne"; files: "/etc/motd" template_method => "inline_mustache", edit_template_string => 'Welcome to {{{vars.sys.fqhost}}}! For support issues please contact {{{vars.motd.owner}}}.'; }
-top-
data handed to the templating engine@
Currently iterated key%
Multi-line JSON representation of data$
Serialized JSON representation of databundle agent main { vars: "d" data => '{ "key": "value", "list": ["one", "two"]}'; reports: "Multiline: $(with)" with => string_mustache( "{{%-top-}}", d); "Serial: $(with)" with => string_mustache( "{{$-top-}}", d); "Keys: $(with)" with => string_mustache( "{{#-top-}}{{{@}}}, {{/top}}", d); }
R: Multiline: { "key": "value", "list": [ "one", "two" ] } R: Serial: {"key":"value","list":["one","two"]} R: Keys: key, list,
bundle agent main { vars: "keys" slist => lsdir("/etc/ssh", "ssh_host_\w+_key", "false"); "$(keys)" data => data_regextract("ssh_host_(?<type>\w+)_key", $(keys) ); "type[$(keys)]" string => "$($(keys)[type])", meta => { "inventory", "attribute_name=SSH HostKey Type" }; # Warning ssh-keygen output may vary across versions "fingerprint[$(keys)]" string => nth( string_split( execresult("/usr/bin/ssh-keygen -l -f /etc/ssh/$(keys).pub", noshell), "\s+", 5), 1), meta => { "inventory", "attribute_name=SSH HostKey Fingerprint" }; reports: "/etc/ssh/$(keys).pub type: $($(keys)[type]) fingerprint: $(fingerprint[$(keys)])"; }
R: /etc/ssh/ssh_host_ed25519_key.pub type: ed25519 fingerprint: SHA256:NA04HcvSPZ/wAp/vJUIcOV799ImTWnbFEX0R9R2SXUI R: /etc/ssh/ssh_host_ecdsa_key.pub type: ecdsa fingerprint: SHA256:gN37F6qt7vkYvVzxgOii5hNzu7EPJw/yTvEnRtr+rLk R: /etc/ssh/ssh_host_dsa_key.pub type: dsa fingerprint: SHA256:/5b5NncWQL43gi9AQarZvVoQW5M+LJxk8KqFYGvZpqI R: /etc/ssh/ssh_host_rsa_key.pub type: rsa fingerprint: SHA256:tSRcjuKPF6W/jcyhqYG7tHlVkcrUZGh0RmwFEEpMPzc
Write a policy that populates /etc/issue
with legaleze.
Write a policy that creates at least 2 users.
Tag the variable(s) that contain the usernames you promised for inventory.
meta => { "inventory", "attribute_name=My users" }
:PR :ID97441-1e2f-42ed-afbf-1658e1376199 :EN
Wri that ensures /etc/cron.allow
is populated with one of the previously created users allowed to have cron jobs.
Swier and try to crontab -e
.
Inventory the users listed in /etc/cron.allow
Write a policy that enables the ssh banner and directs it to /etc/issue
. sshd
should be restarted after changing its configuration.
:PR :ID4c834-6662-40bf-b16e-d5ad864fdcd9 :EN
#+Cup for the example #+Bell sudp/immutable sudi /tmp/immutable #+E
bundle agent main { files: "/tmp/immutable" create => "true", edit_line => example_edit_line, classes => results("bundle", "my_id"); vars: "classes" slist => classesmatching(".*my_id.*"); reports: "Found Class = '$(classes)'"; } bundle edit_line example_edit_line { insert_lines: "I want to edit an immutable file"; }
error: Can't copy file permissions from '/tmp/immutable' to '/tmp/immutable.cf-after-edit' - so promised edits could not be moved into place. error: Unable to save file '/tmp/immutable' after editing R: Found Class = 'my_id_failed' R: Found Class = 'my_id_not_kept' R: Found Class = 'my_id_error' R: Found Class = 'my_id_kept' R: Found Class = 'my_id_reached'
Refer to implementation of the results
classes body in the stdlib.
#+Canup immutable file
sudo chattr -i /tmp/immutable sudo rm /tmp/immutable
Write a policy that defines a name in separate parts (at least 3). Then have CFEngine report the name in a random order.
bundle agent main { vars: "name_parts" slist => { "Ronald", "Mck", "Donald" }; "shuffled" slist => shuffle( name_parts, randomint(0, inf) ); "name" string => join(" ", shuffled ); reports: "$(name)"; }
R: Donald Mck Ronald R: Donald Ronald Mck R: Ronald Donald Mck
Write policy to monitor a file for change. When a change is seen report Winner
Winner Chicken Dinner
. Manually edit the file, show how cfengine detects and
reports on the change.
Write a policy that will abort cfengine execution if the file
$(sys.statedir)/abort_agent_execution
exists.
Write a policy that will delete $(sys.statedir)/abort_agent_execution
if it is
older than 1 hour.
Write a policy to kill irssi running on webservers.  Ref update_def.cf
classes: "trigger_upgrade" or => { "host1", "host2", "redhat_5" };
With mergedata()
it is possible to wrap data containers inside of a new JSON
data structure in the current namespace.
For example, here we take an array of objects describing content for pghba.conf file and re-parent it under the pghba key in a new data-structure.
bundle agent main { vars: "pghba_directives" data => '[ { "type": "host", "database": "replication", "user": "all", "address": "secondary-replication", "method": "trust" } ]'; "data" data => mergedata( '{ "pghba": pghba_directives }'); reports: "$(with)" with => string_mustache( "{{%-top-}}", data); }
R: { "pghba": [ { "address": "secondary-replication", "database": "replication", "method": "trust", "type": "host", "user": "all" } ] }
cf-promises --eval-functions=yes --full-check \
-f ./examples/00-01-hello_world.cf
body common control
(or bundle agent main
). Typically this is only used when you run cf-promsies against promises.cf
, update.cf
, or standalone_self_upgrade.cf
cf-promises -f ./examples/00-01-hello_world.cf
Build into your workflow!
noshell
vs useshell
for commands
type promises, execresult()
, and returnszero()
useshell
allows you to use pipelinesbundle agent main { vars: "result_with_shell" string => execresult( "/bin/echo 'Hello$(const.n) World' | grep Hello", useshell); reports: "$(result_with_shell)"; }
R: Hello
useshell
allows you to redirect outputbundle agent main { classes: "successfully_executed" expression => returnszero( "/bin/echo 'Hello$(const.n) World' | grep -i world > $(this.promise_filename).out ", useshell); reports: successfully_executed:: "Successfully Executed"; "Grep found: " printfile => cat( "$(this.promise_filename).out" ); }
R: Successfully Executed R: Grep found: R: World
useshell
allows you to use unqualified commandsbundle agent main { vars: # Note that echo is not fully qualified. That's because it picked it up # from the shells PATH "result" string => execresult( "echo 'Hello World'", useshell); reports: "Result: $(result)"; }
R: Result: Hello World
cf-remote
cf-remote install --hub <IP_ADDRESS> --bootstrap <IP_ADDRESS>
cf-locate
cf-locate
Use standardized DEBUG
reports for policy development and troubleshooting.
bundle agent main { reports: DEBUG|DEBUG_this_bundle_name:: "DEBUG $(this.bundle): ...."; "DEBUG|DEBUG_$(this.bundle)":: "DEBUG $(this.bundle): ...."; }
Use promise comments to document WHY the promise is important.
bundle agent main { services: "firewalld" policy => "start", comment => "If this service isnt running, then we have unnecessary exposure and increase our risk of a security breach."; }
jq
echo '{ "data": [ { "firstseen": "1578745699", "hostname": "host001.example.com", "id": "SHA=e01f65d069b9035c280ea0bdba6cf6e47863ac074a170addbad26e98cc89925c", "ip": "<IP_ADDRESS>", "lastreport": "1582643957" }, { "firstseen": "1578745692", "hostname": "hub.example.com", "id": "SHA=70138d580b9fd292ff856746df2fe7f9ded29db9ffca0c4d83acbbb97cde4d42", "ip": "<IP_ADDRESS>", "lastreport": "1582643974" } ], "meta": { "count": 2, "page": 1, "timestamp":<PHONE_NUMBER>, "total": 7 } }'
{ "data": [ { "firstseen": "1578745699", "hostname": "host001.example.com", "id": "SHA=e01f65d069b9035c280ea0bdba6cf6e47863ac074a170addbad26e98cc89925c", "ip": "<IP_ADDRESS>", "lastreport": "1582643957" }, { "firstseen": "1578745692", "hostname": "hub.example.com", "id": "SHA=70138d580b9fd292ff856746df2fe7f9ded29db9ffca0c4d83acbbb97cde4d42", "ip": "<IP_ADDRESS>", "lastreport": "1582643974" } ], "meta": { "count": 2, "page": 1, "timestamp":<PHONE_NUMBER>, "total": 7 } }
echo $INPUT | jq '.data | map(.ip) | join(",")'
<IP_ADDRESS>,<IP_ADDRESS>
cf-runagent
cf-runagent --background=3 --remote-bundles satellite_registration \ -H $(curl -s -k --user $USER:$PASSWORD \ https://$HUB/api/host\?count\=2\&context-include\=not_rh_satellite_registered |\ jq '.data | map(.ip) | join(",")'|tr -d '"')
cf-locate
cf-keycrypt
cf-profile
vim_cf3
reindent.pl
cfe-rsplaytime
cfe-profiler
Git is the most popular modern version control management tool. Github, Bitbucket, and GitLab all provide great hosted and on prem repository management solutions.
Using a git management system is reccomended for implementing access controls and improved collaboration with regard to policy and systems management.
Log into the policy server
[user@workstation] $ vagrant ssh hub [vagrant@hub] $ sudo -i
Configure git author
[root@hub masterfiles] # git config -–global user.name “Mr. Slate” [root@hub masterfiles] # git config -–global user.email<EMAIL_ADDRESS>[root@hub masterfiles] # git config --global push.default simple
[root@hub masterfiles] # git clone /opt/cfengine/masterfiles.git /vagrant/masterfiles Cloning into '/vagrant/masterfiles'...
[root@hub masterfiles] # cd /vagrant/masterfiles [root@hub masterfiles] # ls cfe_internal Changelog controls def.cf lessons lib libraries promises.cf services sketches update update.cf [root@hub masterfiles] # echo hi > file [root@hub masterfiles] # git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # file nothing added to commit but untracked files present (use "git add" to track)
[root@hub masterfiles] # git add file [root@hub masterfiles] # git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..."  Delta compression using up to 2 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 280 bytes, done. Total 3 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (3/3), done.  # # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: file # no changes added to commit (use "git add" and/or "git commit -a")
[root@hub masterfiles] # git diff diff --git a/file b/file index 45b983b..313352b 100644 --- a/file +++ b/file @@ -1 +1,2 @@ hi +HI
[root@hub masterfiles] # git add file [root@hub masterfiles] # git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # # Changes to be committed: # (use "git reset HEAD <file>..."  Delta compression using up to 2 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (5/5), 493 bytes, done. Total 5 (delta 2), reused 0 (delta 0) Unpacking objects: 100% (5/5), done.  to unstage) # # deleted: file # # git commit -m "Remove file" [master 4c9d46d] Remove file 1 files changed, 0 insertions(+), 3 deletions(-) delete mode 100644 file
[root@hub masterfiles] # git push Counting objects: 3, done. Delta compression using up to 2 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 230 bytes, done. Total 2 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (2/2), done. To /opt/cfengine/masterfiles.git 92660a9..4c9d46d master -> master
[root@hub masterfiles] # rsync -avz /var/cfengine/masterfiles/ . [root@hub masterfiles] # git add -A [root@hub masterfiles] # git commit -m "Seed repository with masterfiles" [root@hub masterfiles] # git push
[root@hub masterfiles]# echo '{ "classes": { "cfengine_internal_masterfiles_update": [ "policy_server" ] } }' > def.json [root@hub masterfiles]# git add def.json [root@hub masterfiles]# git commit -m "Enable automatic masterfiles update from repository" [master c206654] Enable automatic masterfiles update from repository 1 file changed, 1 insertion(+) create mode 100644 def.json [root@hub masterfiles]# git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) Counting objects: 4, done. Delta compression using up to 2 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 370 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) To /opt/cfengine/masterfiles.git a181449..c206654 master -> master
[root@hub masterfiles]# cf-agent --no-lock \ --verbose \ --define cfengine_internal_masterfiles_update \ --file update.cf
[root@hub masterfiles]# cat /var/cfengine/masterfiles/def.json
Now when the agent runs on hosts that define policy_server
policy will be
activated that keeps /var/cfengine/masterfiles
up to date with whats in the
repository as configured in mission portal (which by default is
/opt/cfengine/masterfiles.git
).
This means new policy will be distributed as you push it into the repository. Continuous delivery FTW!
git status |
git pull --rebase |
git diff |
git grep |
git add |
git log |
git diff --cached |
git checkout -b new_feature |
git commit |
git push origin <branch> |
CFEngine


--- title: Hacktoberfest at PES University layout: landing footer: false # articles: # excerpt_type: html #excerpt: > # Hacktoberfest at PES University # permalink: /hacktoberfest article_header: # actions: height: 5vh theme: dark background_color: "#52C41A" background_image: # gradient: "linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .1))" # src: /docs/assets/images/cover4.jpg #data: # sections: # - title: # theme: dark # actions: # - text: ' Send Us A Message' # type: secondary # url: /contact/ # background_color: "#152347" ---
Learn more about Hacktoberfest here
Queries? Contact us.


I've noticed information about allergic reactions with 2C-B.
I've recently noticed that these allergies may extend to 2C-I. At a high dose (26mg - orally), I've experienced rapid mucus production which resulted in difficulty breathing, great discomfort (which could alter the psychological course of a trip) and vomiting of mucus. I'd describe the amount of mucus I had as unfathomable . I also noticed that my levels of mucus production remained high, although not as high, in the hours after the 2C-I wore off. These side effects are what led to coughing in some, I suspect.
I feel it may be noteworthy that I did have a cold during this time, so mucus production may have simply been accelerated rather than created. These side effects were not experienced at all at lower doses. I must say, though, that these side effects were so negative, that they may deter me from trying the substance again.
Since then, I've actually run a few more trials with this substance and found this side effect to be non-existent afterwards. I am beginning to suspect that other overlooked factors may come into play with this (since I have several acquaintances who have reported similar experiences). Perhaps
trace impurities could be a factor?
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Let’s go back to our newspaper delivery examples, but this time we will only look at the deliveries where money is paid for the newspaper.
Below is an attempt at a solution that would work both Ms. Lovelace’s world Newspaper 1, and Mr. Babbage’s Newspaper 2:
from library import turn_right, turn_around
def climb_up_one_floor():
turn_left()
move()
turn_right()
move()
move()
def climb_down_one_floor():
move()
move()
turn_left()
move()
turn_right()
def get_money():
while object_here() :
take()
# === End of definitions ===
take()
while not object_here():
climb_up_one_floor()
get_money()
put() # leave Star newspaper
turn_around()
while not at_goal() :
climb_down_one_floor()
Important test!
Reproduce the above program, run it and note the result.
As you will see, when Reeborg attempts to execute the instruction put() at the line highlighted in yellow above, it stops and shouts I carry too many different objects. I don't know which one to put down!.
So, the problem is that Reeborg is carrying both money (tokens) and a newspaper (star).
A solution?
Change the program so that Reeborg puts down the newspaper before it takes the money. Does this work?
When there are two or more types of objects at a given location, for example a star and some tokens in the worlds mentioned above, and we instructs Reeborg to take(), Reeborg cannot know which type of object it must take. Similarly, if Reeborg carries many types of objects and we simply ask him to put(), it cannot know which one it should put down.
The solution is simple: we need to be more specific.
We have seen function arguments. And, by a happy coincidence (!), it just happens that the functions take() and put() can accept an argument. In the case that interests us, the Star newspaper is represented by a star, and the argument to use is "star" as in
take("star")
put("star")
For money, we use "token".
Your turn!
Change the program above to specify which type of object Reeborg must take or put down. Make sure that your program works correctly for both worlds, Newspaper 1 and Newspaper 2. You might want to use think() to occasionally speed up or slow down Reeborg’s motion.
Another option
Change again your program to replace object_here() by object_here("token") and make sure it still works.


usefulcolgate's products
100% UNDECTECTABLE COUNTERFIETS AUSTRALI...
CHEAP PREPAID VISA CARDS, CLOAN CARD, 20...
Grade A++ undictated counterfeit banknot...
CHEAP PREPAID VISA CARDS, CLOAN CARD, 20...
UNDETECTABLE COUNTERFEIT USD 100blues 50...
UNDETECTABLE COUNTERFEIT USD 100blues 50...
UNDICTATED CANNADIAN DOLLARS in 20s 5000...
CHEAP PREPAID VISA CARDS, CLOAN CARD, 20...
UNDETECTABLE COUNTERFEIT USD 100blues 50...
GREAT A---UNDETECTABLE COUNTERFIET GBP P...
100% UNDECTECTABLE COUNTERFIETS AUSTRALI...
WESTERN UNION CASHOUT MTCN AVAILABLE 200...
GREAT A---UNDETECTABLE COUNTERFIET GBP P...
GREAT A---UNDETECTABLE COUNTERFIET GBP P...
UNDICTATED CANNADIAN DOLLARS in 20s 5000...
CHEAP PREPAID VISA CARDS, CLOAN CARD, 20...
100% UNDECTECTABLE COUNTERFIETS AUSTRALI...
Grade A++ undictated counterfeit banknot...
UNDETECTABLE COUNTERFEIT USD 100blues 50...
WESTERN UNION CASHOUT MTCN AVAILABLE 200...
Grade A++ undictated counterfeit banknot...
100% UNDECTECTABLE COUNTERFIETS AUSTRALI...
100% UNDECTECTABLE COUNTERFIETS AUSTRALI...
Grade A++ undictated counterfeit banknot...
GREAT A---UNDETECTABLE COUNTERFIET GBP P...
GREAT A---UNDETECTABLE COUNTERFIET GBP P...
GREAT A---UNDETECTABLE COUNTERFIET GBP P...
UNDETECTABLE COUNTERFEIT USD 100blues 50...
100% UNDECTECTABLE COUNTERFIETS AUSTRALI...
Grade A++ undictated counterfeit banknot...


Connect to an external database, pull data from a Rest API, import a CSV, or start from scratch with Budibase's built-in database.
Generate powerful internal tools and forms in just a few seconds. No coding required!
Designing internal tools has never been easier/faster with our premade blocks and drag-and-drop interface.
With just a few clicks, automate manual processes and streamline operations within your app and business.
Deliver internal tools that look beautiful and work perfectly across mobile, tablet, and desktop.


Jacob Jan Wise
Inverted Colors:Off
A somewhat different approach to sleeve design for the first release
of klunk records:
A wearable, flat-packed hat which serves as the cover art for the
release. This cap fits snuggly within the blank sleeve. 140g
transparent vinyl with white labels.
Contact
<EMAIL_ADDRESS>+31(0)639721282
instagram
WiseType©
Clients
Typojanchi
Raycap
United Standard
Kitsune
Crack Magazine
Kaleidoscope


Favorite Meals! (and secret favorite food)
Add New Friends
Name:
Favorite Food:
Favorite Meal:
Submit


Home Shop
By: Daniel Rifenburgh
$12.90
Add to cart
By: Rhys Bowen
By:Lyndsay faye
$40.00
Add to Cart
By: George W Barclay
$17.95
By:Rafael Montejano
$25.00
By: Charles L Geddes


Tools for sound synthesis and acoustic analysis. Performs parametric synthesis of sounds with harmonic and noise components such as animal vocalizations or human voice. Also includes tools for spectral analysis, pitch tracking, audio segmentation, self-similarity matrices, morphing, etc.
| Version: | 1.3.1 |
| Depends: | R (≥ 3.4) |
| Imports: | stats, graphics, utils, tuneR, seewave (≥ 2.1.0), zoo, shiny, reshape2, mvtnorm, plyr, dtw, phonTools |
| Suggests: | knitr, rmarkdown, shinyBS |
| Published: | 2018-10-04 |
| Author: | Andrey Anikin [aut, cre] |
| Maintainer: | Andrey Anikin <rty.anik at rambler.ru> |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| URL: | http://cogsci.se/soundgen.html |
| NeedsCompilation: | no |
| Citation: | soundgen citation info |
| Materials: | README NEWS |
| CRAN checks: | soundgen results |
| Reference manual: | soundgen.pdf |
| Vignettes: |
Acoustic analysis with soundgen Sound generation with soundgen |
| Package source: | soundgen_1.3.1.tar.gz |
| Windows binaries: | r-devel: soundgen_1.3.1.zip, r-release: soundgen_1.3.1.zip, r-oldrel: soundgen_1.3.1.zip |
| OS X binaries: | r-release: soundgen_1.3.1.tgz, r-oldrel: soundgen_1.3.1.tgz |
| Old sources: | soundgen archive |
| Reverse imports: | warbleR |
Please use the canonical form https://CRAN.R-project.org/package=soundgen to link to this page.


Planet of the Apes (2001) 3 1/2 stars out of 4. Starring Mark Wahlberg, Tim Roth, Helena Bonham Carter, Michael Clarke Duncan, Paul Giamatti, Estella Warren, Kris Kristofferson, Cary-Hiroyuki Tagawa, David Warner and Charlton Heston. Screenplay by William Broyles Jr. and Lawrence Konner & Mark Rosenthal. Based on the novel by Pierre Boulle. Music by Danny Elfman. Directed by Tim Burton. Rated PG-13. Approx. 2 hours
I have to say it. Tim Burton's retelling of Planet of the Apes is more fun than a barrel of monkeys.
OK, that's off my chest. No more monkey puns, I promise.
Seriously, though, Planet of the Apes is one rip-roarin' summer outing, filled with thrills, action, adventure, wit and bits of funny (dare I say, monkey) business. I know, I know, I promised.
And for those film buffs who are fond of the original, Burton's version includes a couple tips of the hat to that movie.
Mark Wahlberg stars as Capt. Leo Davidson, a deep-space pilot whose ship gets drawn into a magnetic field and hurled into the future. He crash lands on a planet where apes are the dominant species and humans are hunted, captured and sold into slavery.
Despite being darker than the original, Burton's film is not as heavy handed nor as sanctimonious.
Some of the movie's flashes of humor are surreal as well as typically Burton: An organ-grinder ape with a midget or an elderly ape taking off a wig and removing false teeth as he prepares for bed. Then there are the parents who buy a little girl as a pet for there young daughter. The seller advises the parents to get rid of the girl before she reaches puberty: "One thing you don't want in your house is a human teen-ager," he says. You don't have to be an ape to realize the truth in that statement. Touches such as these are what stamps this movie with Burton's brand.
 Anyone familiar with the first version of the film will, of course, recognize the irony in that piece of dialogue.
Another of Burton's in-jokes is to have Charlton Heston, star of the original, play the chimpanzee father of Tim Roth's Gen. Thade. The young chimp goes to visit his dying father. Both have one thing in common, a hatred of humans.  That is the famous line Heston's Taylor shouted at the conclusion of the original after discovering the planet's terrible secret.
The performances throughout are top-notch. Wahlberg plays Davidson not as some gung-ho hero, but as a confused and somewhat frightened explorer who only wants to return home. He is reluctant to lead the human rebellion; his only objective being to find a way off this upside-down planet. This hesitation is what makes his character believable and vulnerable.
Roth is ferocious, cunning, cruel and savage as the fascist chimp who wants to rid his planet of all vestiges of humanity. He leaps and bounds as if he had springs on his feet. It is a masterful turn.
Helena Bonham Carter is Ari, the chimp who believes that apes and humans can live in peace and as equals. Hers is a smart, compassionate characterization.
Michael Clarke Duncan is big and brutal as Attar the gorilla aid to Thade who blindly follows his leader until his faith is shaken.
A fine comic outing is given by Paul Giamatti as Limbo, the ape slave trader making a living off the misery of the humans he captures. As the battle between apes and humans looms, the cowardly Limbo pleads, "Can't we all just get along," echoing the words of Rodney King.
Much of the success of Planet of the Apes goes to Burton's technical crew, especially production designer Rick Heinrichs and the legendary Rick Baker who created the ape makeup.
Burton's musical collaborator, Danny Elfman, provides another fine score, though it is not as memorable as his work on Batman or Sleepy Hollow.
The movie's only letdown comes at the very end where Burton tries to outshock the finale from the 1968 original. He comes close, but falls short.
Otherwise, Planet of the Apes is what a summer movie should be: An amusement park ride filled with lots of action, stunts and a few laughs. This is one feature in which the expectations lived up to the pre-release hype.
Bob Bloom is the film critic at the Journal and Courier in Lafayette, IN. He can be reached by e-mail at<EMAIL_ADDRESS>or at<EMAIL_ADDRESS>Other reviews by Bloom can be found at www.jconline.com by clicking on golafayette. Bloom's reviews also can be found on the Web at the Internet Movie Database: http://www.imdb.com/M/reviews_by?Bob+Bloom
========== X-RAMR-ID: 28971 X-Language: en X-RT-ReviewID: 240251 X-RT-TitleID: 1108704 X-RT-SourceID: 872 X-RT-AuthorID: 1363 X-RT-RatingText: 3.5/4
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


1 reference to Wait
Microsoft.PowerShell.ConsoleHost (1)
host\msh\Executor.cs (1)
247
pipelineWaiter.
Wait
();


Airbus plane winging its way to France after ‘wet sock’ complaint
- Advertisement -
A new Airbus plane will be sent back to engineers in France following complaints of a “smell of wet sock” from cabin crew in the Pacific island territory of New Caledonia.
The Airbus A330neo came into service on October 4 as part of a fleet renewal at Air Caledonie International (ACI), the french territory’s international airline.
However “a smell of ‘wet sock’ has repeatedly inconvenienced crew members during take off and landing”, ACI’s general manager Didier Tappero told AFP.
An investigation was carried out and identified oil fumes.
- Advertisement -
According to an Airbus report sent to the company, the analysis indicated that the air quality in the cabin was in accordance with international guidelines and below the toxicity threshold, ACI said.
However, blood samples were taken from the flight crew who inhaled the bad smell.
The Airbus A330neo, one of two in ACI’s fleet, has been grounded for two weeks and will shortly be sent to Airbus’ workshops in Toulouse.
“We are working on a solution to solve odor problems in the cabin of a small number of Airbus A330neo in service,” Airbus spokesman Sean Lee told AFP.
Similar problems have been encountered by airlines in Portugal and Senegal.
© Agence France-Presse
- Advertisement -


The world evolves really fast, as the human population changes and grows. The economy in each country has to adapt itself to these modifications and search for new creative ways to produce incomes for its people. This is why; the future depends on how innovative a person can be! Because the more open minded the person is, the more alternatives he’ll have to succeed. Nowadays, the industry of tourism is one the most lucrative and innovative compared to the rest of the economic activities. Not only because of its performance when to compete with food or vehicles industries, the way it can adapt through time; but also because today there are countries that fully depend on it. To explain the importance of tourism, I’ll start talking about the importance of the economic movement it produces. The statistics made by the World Tourism Organization in 2017 show us how 1 of every 10 jobs in the world belong purely to this activity. Also, the estimated number of people a company of tourism hires is 10 persons. Not only the mentioned, but the money it generates in numbers: the direct economic impact of the industry (including accommodation, transportation, entertainment and attractions) is approximately 2.3 trillion U.S. dollars a year (2016). In addition to this factor, tourism has a multiplier effect. This means that tourism generates an impact in other areas or activities. A clear example of it is when the government must support the private companies of tourism by creating the corresponding infrastructure, in order to help them to provide a better service for the tourists at a specific place. By doing this the government not only helps tourism, but also improves the lives of the population located in that space. The list of actions a Government can do to promote the tourism is long, but some of the most important points are: Secure environments, roads and medical posts. Furthermore, this industry encourages the creation of Environmental Protection laws and Cultural Preservation activities. Due there are more tourists on the world that travel around the globe looking for authentic experiences, each country wants to protect their natural areas and their cultural heritage. In this way, both the private and the public area have to get together and cooperate to make the right legislation that can help the country look after its belongings. However, there are some negative counterparts about this activity. For example, the tourist overpopulation in some destinations. This phenomenon damages the environment of a site, especially when a big movement of people weren´t planned. That’s why, it’s important to promote the arrival of conscious tourist and to prevent the quantity of people a place can sustain. In conclusion, tourism is an economic activity that can not only generate a big flow in the earnings of a specific site, but also it can improve the lives of the people. It’s an activity that helps us notice the beauty in every corner and also, encourages us to preserve although the changes of time. Tourism can be a powerful weapon that with the correct usage can make a big difference.


pymatgen.analysis.piezo_sensitivity module¶
Piezo sensitivity analysis module.
-
class
BornEffectiveCharge
(structure, bec, pointops, tol=0.001)[source]¶ Bases:
object
This class describes the Nx3x3 born effective charge tensor
Create an BornEffectiveChargeTensor object defined by a structure, point operations of the structure’s atomic sites. Note that the constructor uses __new__ rather than __init__ according to the standard method ofsubclassing numpy ndarrays.
- Parameters
input_matrix (Nx3x3 array-like) – the Nx3x3 array-like representing the born effective charge tensor
-
get_BEC_operations
(eigtol=1e-05, opstol=0.001)[source]¶ Returns the symmetry operations which maps the tensors belonging to equivalent sites onto each other in the form [site index 1, site index 2, [Symmops mapping from site index 1 to site index 2]]
- Parameters
eigtol (float) – tolerance for determining if two sites are
by symmetry (related) –
opstol (float) – tolerance for determining if a symmetry
relates two sites (operation) –
- Returns
list of symmetry operations mapping equivalent sites and the indexes of those sites.
-
class
ForceConstantMatrix
(structure, fcm, pointops, sharedops, tol=0.001)[source]¶ Bases:
object
This class describes the NxNx3x3 force constant matrix defined by a structure, point operations of the structure’s atomic sites, and the shared symmetry operations between pairs of atomic sites.
Create an ForceConstantMatrix object.
- Parameters
input_matrix (NxNx3x3 array-like) – the NxNx3x3 array-like representing the force constant matrix
-
get_FCM_operations
(eigtol=1e-05, opstol=1e-05)[source]¶ Returns the symmetry operations which maps the tensors belonging to equivalent sites onto each other in the form [site index 1a, site index 1b, site index 2a, site index 2b, [Symmops mapping from site index 1a, 1b to site index 2a, 2b]]
- Parameters
eigtol (float) – tolerance for determining if two sites are
by symmetry (related) –
opstol (float) – tolerance for determining if a symmetry
relates two sites (operation) –
- Returns
list of symmetry operations mapping equivalent sites and the indexes of those sites.
-
get_asum_FCM
(fcm, numiter=15)[source]¶ Generate a symmeterized force constant matrix that obeys the objects symmetry constraints and obeys the acoustic sum rule through an iterative procedure
- Parameters
fcm (numpy array) – 3Nx3N unsymmeterized force constant matrix
numiter (int) – number of iterations to attempt to obey the acoustic sum rule
- Returns
numpy array representing the force constant matrix
-
get_rand_FCM
(asum=15, force=10)[source]¶ Generate a symmeterized force constant matrix from an unsymmeterized matrix that has no unstable modes and also obeys the acoustic sum rule through an iterative procedure
- Parameters
force (float) – maximum force constant
asum (int) – number of iterations to attempt to obey the acoustic sum rule
- Returns
NxNx3x3 np.array representing the force constant matrix
-
get_stable_FCM
(fcm, fcmasum=10)[source]¶ Generate a symmeterized force constant matrix that obeys the objects symmetry constraints, has no unstable modes and also obeys the acoustic sum rule through an iterative procedure
- Parameters
fcm (numpy array) – unsymmeterized force constant matrix
fcmasum (int) – number of iterations to attempt to obey the acoustic sum rule
- Returns
3Nx3N numpy array representing the force constant matrix
-
get_symmetrized_FCM
(unsymmetrized_fcm, max_force=1)[source]¶ Generate a symmeterized force constant matrix from an unsymmeterized matrix
- Parameters
unsymmetrized_fcm (numpy array) – unsymmeterized force constant matrix
max_charge (float) – maximum born effective charge value
- Returns
3Nx3N numpy array representing the force constant matrix
-
class
InternalStrainTensor
(structure, ist, pointops, tol=0.001)[source]¶ Bases:
object
This class describes the Nx3x3x3 internal tensor defined by a structure, point operations of the structure’s atomic sites.
Create an InternalStrainTensor object.
- Parameters
input_matrix (Nx3x3x3 array-like) – the Nx3x3x3 array-like representing the internal strain tensor
-
get_IST_operations
(opstol=0.001)[source]¶ Returns the symmetry operations which maps the tensors belonging to equivalent sites onto each other in the form [site index 1, site index 2, [Symmops mapping from site index 1 to site index 2]]
- Parameters
opstol (float) – tolerance for determining if a symmetry
relates two sites (operation) –
- Returns
list of symmetry operations mapping equivalent sites and the indexes of those sites.
-
get_piezo
(BEC, IST, FCM, rcond=0.0001)[source]¶ Generate a random piezoelectric tensor based on a structure and corresponding symmetry
- Parameters
BEC (numpy array) – Nx3x3 array representing the born effective charge tensor
IST (numpy array) – Nx3x3x3 array representing the internal strain tensor
FCM (numpy array) – NxNx3x3 array representing the born effective charge tensor
rcondy (float) – condition for excluding eigenvalues in the pseudoinverse
- Returns
3x3x3 calculated Piezo tensor
-
rand_piezo
(struc, pointops, sharedops, BEC, IST, FCM, anumiter=10)[source]¶ Generate a random piezoelectric tensor based on a structure and corresponding symmetry
- Parameters
struc (pymatgen structure) – structure whose symmetry operations the piezo tensor must obey
pointops – list of point operations obeyed by a single atomic site
sharedops – list of point operations shared by a pair of atomic sites
BEC (numpy array) – Nx3x3 array representing the born effective charge tensor
IST (numpy array) – Nx3x3x3 array representing the internal strain tensor
FCM (numpy array) – NxNx3x3 array representing the born effective charge tensor
anumiter (int) – number of iterations for acoustic sum rule convergence
- Returns
list in the form of [Nx3x3 random born effective charge tenosr, Nx3x3x3 random internal strain tensor, NxNx3x3 random force constant matrix, 3x3x3 piezo tensor]


2015/12/01 - Schools shut down over lesson on Islam - CNN Video Breaking News U.S. + Crime + Justice Energy + Environment Extreme Weather Space + Science U.S. World Politics Money Opinion Health Entertainment Style Travel Sports Video Live TV Search ? U.S. Edition + U.S. International Arabic
Cache Page (Cached on 20151219)Schools shut down over lesson on Islam - CNN Video Breaking News U.S. + Crime + Justice Energy + Environment Extreme Weather Space + Science U.S. World Politics Money Opinion Health Entertainment Style Travel Sports Video Live TV Search ? U.S. Edition + U.S. International Arabic
Cache Page (Cached on 20151219)