Skip to main content

a silhouette of a person's head and shoulders, used as a default avatar

在 KDE 中開啟 samba 分享的 office 文件

症狀:
KDE 桌面環境
在 samba 分享的資料夾中可以看見 doc docx xls xlsx odt ods 之類
需要用到 libreoffice 開啟的檔案
只能複製到本機上才能開啟
無法在檔案管理員中直接點擊開啟

請參考

https://ask.libreoffice.org/en/question/23021/solved-open-ods-or-odt-files-from-a-smb-share-throws-damaged-file-error/

解決方法:

$sudo zypper in orbit2 libreoffice-gnome

$vi ~/.profile

add

export OOO_FORCE_DESKTOP=gnome

重新登入即可

a silhouette of a person's head and shoulders, used as a default avatar

安裝與設定 PaperCut client

PaperCut 是一個列印管理收費系統
提供了 windows , mac 和 linux 的客戶端

首先連上列印伺服器,此例為 192.168.4.13 ,您需要依照實際的情況設定

















由 PCClient 目錄中找到 linux 目錄
將整個目錄複製到您的電腦上

修改 config.properties
將伺服器的位址(server-ip)改成正確的伺服器位址





















然後將 pc-client-linux.sh 改成可執行檔

$chmod +x pc-client-linux.sh

執行 pc-client-linux.sh
輸入使用者代號及密碼即可












這是一個用 java 寫的程式,若無法執行,請檢查您的 java 環境


接下來設定印表機
您可以用 CUPS 來設定
開啟瀏覽器輸入 http://localhost:631

請詢問您的管理員相關的連線資訊
例如印表機的佇列
在我這裡的情況要設定成

lpd://192.168.4.13/Gestetner

最後是應用程式端的印表機設定
檔案按列印之後,選擇印表機,按下屬性(C)
















在裝置分頁中的選項
點選 User Code
右邊自訂按兩下
即可輸入您的使用者代碼
然後按確定
即可回到上一頁列印





















a silhouette of a person's head and shoulders, used as a default avatar

Wallpapers

Part of GNOME's visual identity are the default wallpapers. Ever since GNOME3 was released, regardless of the release version, you can tell a stock GNOME desktop from afar. Unlike what most Linux distributions do, we don't change the wallpaper thematically from release to release and there is a strong focus on continuity.

Adwaita 3.18 Day

While both Android and Windows are going analog, we're not that hipster. If you follow my journal, you probably wouldn't be shocked to hear I mainly use Blender to create the wallpapers. In the past Inkscape took a major part in the execution, but its lacking implementation of gradients leads to dramatic color banding in the subtle gradients we need for the wallpapers. I used to tediously compensate for this in GIMP, using noisify filters while working in high bit depth and then reducing color using GEGL's magical color reduction operation that Hans Peter Jensen wrote a while a back. It allows to chose various dithering algorithms when lowering the bit depth.

However thanks to Cycles, we get the noise for free :) Actually it's one of the things I spend hours and hours waiting for getting cleaned up with iterations. But it does help with color banding.

Blender rendering the night variant of the 3.20 Adwaita wallpaper (work in progress).

In my work I have always focused on execution. Many artists spend a great deal of time constructing a solid concept and have everything thought out. But unless the result is well executed, the whole thing falls apart. GNOME Wallpapers are really just stripes and triangles. But it's the detail, the light play, the sharpness, not too much high density information that make it all work.

First iterations of the GNOME 3.20 variants are beginning to land in the gnome-backgrounds module. Check it out.

Morning Day Night Lock Screen

a silhouette of a person's head and shoulders, used as a default avatar

SVG animation

I haven't written a post in quite a while, so I decided to document my failure to come up with a viable alternative to the translatable animations we use in Getting Started documentation. So let's start with what's wrong with it. Despite being far more maintainable than a screencast, it's still a major hassle to keep the videos in sync with the developing designs. Every translation requires a re-render of all the frames and it quickly grows into gigabytes per language.

Video

If you're interested in seeing how these were produced, see the Behind the Scenes of getting Started video.

The animations themselves aren't super complex. Basic transforms (translation, scale and rotation) and opacity is all that's needed. And because we are using translatable SVGs in Mallard, it was time to look into SVG animation. There are numerous options available to animate in SVG, which already gave me a hint that none of them will work properly for my use case. I hate being right.

SMIL

I'll starts with the one I like least. The inline garbage approach. SMIL. Each attribute of an SVG element is animateable. Creating a global sequence using this by hand is close to impossible. Its capabilities do include a few extras like animating an object along a path, but in general I cannot imagine editing this by hand. Incorporating Inkscape into the workflow seemed feasible first. Inkscape will not touch the XML it doesn't know about. It will not clean out any of the animation stuff when you save. The xlink namespace definition to animate along path seems to have worked, but I can't figure out some weird offsets. Groups usually get some matrix transforms as soon as you reposition them. It all may boil down to Inkscape using its own coordinate system, I don't know. I haven't succeeded to bolt some animation on the Inkscape generated SVG.

SMIL

CSS

A much more appealing was the concept of using CSS animation. We do a lot of transitions and some animation in gtk+, so it would have been great to reuse the same technology here. While CSS transitions are spot on, animation with a sense of a global timeline is not really the use case for the web. Usually animation in the intended context is an individual transform happening after an event triggered. Creating a sequence of various objects animating in a global timeline is pretty awkward. Especially if you want to loop the whole animation infinitely. The only tools for your disposal is either a time offset or relative time keyframes, keeping all objects' animation the same length.

CSS Based animation of a #cursor1 with a JS playback reset button that doesn't work. ;)

I also ran into Firefox and Webkit interpreting transform-origin differently.

.run-animation {
  transform-origin: top left;
  animation: cursor-move 2s ease 1s forwards, 
                    fade-in 1s linear 0s, 
                    cursor-click .25s ease 3s alternate 2;
  }
@keyframes fade-in {
  from { opacity: 0;  }
  to {  opacity: 1; }
}
@keyframes cursor-move {
  from { opacity: 1;  }
  to {  opacity: 1; transform: translate(100px,-100px);}
}
@keyframes cursor-click {
  from { transform: translate(100px,-100px) scale(1); }
  to { transform: translate(100px,-100px) scale(.5); }
}

The above CSS uses animation-delay. It might be possible to have all keyframes last the same time and use the keyframes relative keyframing for timing (duplicate same keyframe to "hold"). I can't imagine retiming or generally modify an existing animation hand constructed using CSS' keyframes though. A visual tool with a timeline would be necessary.

Javascript

There are many js based frameworks to aid creating and animating SVG documents in realtime, but none of them seem to aid me in creating a global complex animation using assets created in Inkscape. I looked at Google Webdesigner next.

Google Webdesigner

Google Webdesigner has all the necessary visual tools like property keyframing and a global timeline. Sadly it produces a rather less self contained set of html, js and css files. I didn't figure out a way how that could be brought into Mallard.

In the end, even though the animations don't seem to be that complex, maintaining them by hand doesn't seem very doable. A visual editor is required. If Google Webdesigner can be taught to produce a standalone SVG or Mallard taught to use iframes, I'm all ear. Any pointers to a similar tool is also welcome.

a silhouette of a person's head and shoulders, used as a default avatar

Настройка звука в конфигурации с несколькими одинаковыми звуковыми картами

Имеется следующая конфигурация. Два звуковых устройства, оба управляются одним и тем же модулем snd-hda-intel. Первое устройство отвечает за звуковой канал в HDMI, встроенной в процессор графической системы. Второй устройство — обычный интегрированный на материнскую плату аудио-контроллер.
00:03.0 Audio device [0403]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
00:1b.0 Audio device [0403]: Intel Corporation 9 Series Chipset Family HD Audio Controller [8086:8ca0]
Пользователи жалуются, что звук не работает. Проблема состоит в том, что YaST создаёт следующую конфигурацию в 50-sound.conf:
options snd slots=snd-hda-intel,snd-hda-intel
alias snd-card-0 snd-hda-intel
alias snd-card-1 snd-hda-intel
Здесь snd-card-0 — звуковое устройство "по умолчанию". Очевидно, что в таком подходе ситуация, когда один и тот же модуль отвечает за два устройства, обрабатывается не корректно. Кто из устройств первый попал в функцию azx_probe модуля, тот и станет snd-card-0. В нашем случае, это не то устройство, которое нам хотелось бы. Это можно проверить, сделав
ls -l /sys/class/sound/card0/device
lrwxrwxrwx 1 root root 0 окт  9 21:36 /sys/class/sound/card0/device -> ../../../0000:00:03.0

Для восстановления правильного порядка предлагается делать следующее.
Во-первых, внимательно изучив исходники модуля, добавляем в 50-sound.conf:
options snd-hda-intel index=1,0
Во-вторых, надеемся, что при следующих загрузках порядок инициализации не будет меняться случайным образом, потому-что кто первый попадет в функцию azx_probe, тот теперь и будет card1. И это всё происходит в 2015 году, когда повсюду systemd и прочий udev, а звуковую карту за её DeviceId привязать нельзя.
a silhouette of a person's head and shoulders, used as a default avatar

Настройка звука в конфигурации с несколькими одинаковыми звуковыми картами

Имеется следующая конфигурация. Два звуковых устройства, оба управляются одним и тем же модулем snd-hda-intel. Первое устройство отвечает за звуковой канал в HDMI, встроенной в процессор графической системы. Второй устройство — обычный интегрированный на материнскую плату аудио-контроллер.
00:03.0 Audio device [0403]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
00:1b.0 Audio device [0403]: Intel Corporation 9 Series Chipset Family HD Audio Controller [8086:8ca0]
Пользователи жалуются, что звук не работает. Проблема состоит в том, что YaST создаёт следующую конфигурацию в 50-sound.conf:
options snd slots=snd-hda-intel,snd-hda-intel
alias snd-card-0 snd-hda-intel
alias snd-card-1 snd-hda-intel
Здесь snd-card-0 — звуковое устройство "по умолчанию". Очевидно, что в таком подходе ситуация, когда один и тот же модуль отвечает за два устройства, обрабатывается не корректно. Кто из устройств первый попал в функцию azx_probe модуля, тот и станет snd-card-0. В нашем случае, это не то устройство, которое нам хотелось бы. Это можно проверить, сделав
ls -l /sys/class/sound/card0/device
lrwxrwxrwx 1 root root 0 окт 9 21:36 /sys/class/sound/card0/device -> ../../../0000:00:03.0

Для восстановления правильного порядка предлагается делать следующее.
Во-первых, внимательно изучив исходники модуля, добавляем в 50-sound.conf:
options snd-hda-intel index=1,0
Во-вторых, надеемся, что при следующих загрузках порядок инициализации не будет меняться случайным образом, потому-что кто первый попадет в функцию azx_probe, тот теперь и будет card1. И это всё происходит в 2015 году, когда повсюду systemd и прочий udev, а звуковую карту за её DeviceId привязать нельзя.

the avatar of Chun-Hung sakana Huang

Ansible install with openSUSE 13.2 and Mac

I start to study Ansible cause recently needs.

Ansible is python based, using SSH deploy packages to remote servers, it's like Puppet / Chef / Salt.


Online resource

I study from Oreilly - Ansible up & running
  • code example

    

How to install Ansible

Install Ansible

openSUSE 13.2 ( Most of linux could install ansible now )
Use zypper to query ansible package
# zypper   search   ansible
Loading repository data...
Reading installed packages...

S | Name    | Summary                                                                  | Type      
--+---------+--------------------------------------------------------------------------+-----------
 | ansible | SSH-based configuration management, deployment, and orchestration engine | package   
 | ansible | SSH-based configuration management, deployment, and orchestration engine | srcpackage

Install Ansible
# zypper install  -y  ansible

That's all you need to do :-)

Ansible is clientless, that mean you don't need to install any packages in your remote hosts, it's the most diff with puppet and other tools.
The role is
  • The control machine
    • The one that you use to control remote machines
    • needs to have python 2.6 or later installed.  
  • To manage a server with Ansible
    • Needs to have SSH and Python 2.5 or later installed.
Most linux has python later 2.5 ( Might be python 2.7 ), that's the reason - Nothing to install

What do you need to know? ( From Oreilly book ^^ )
I think the most important point is - you could use ssh and ssh key to execute some commands in remote servers.

What do I need to know?
    • Connect to a remote machine using SSH.
    • Interact with the bash command-line shell (pipes and redirection).
    • Install packages.
    • Use the sudo command.
    • Check and set file permissions.
    • Start and stop services.
    • Set environment variables.
    • Write scripts ( Any language )
  • You don't need to know python to use Ansible unless you want to write your own module.
  • You will need to learn some YAML and Jinja2 to use Ansible.     


That's all today, I will write some Ansible module command next time.

~ enjoy it

the avatar of Just Another Tech Blog

UNDERGRADUATE IMPLEMENTATION OF GARBAGE COLLECTION

Authors: David Mulder, Curtis Welborn

ABSTRACT

This paper describes the implementation of a garbage collector as an undergraduate research project. The garbage collector is a continuation of a project where an Assembler, Virtual Machine and Compiler were implemented as a capstone project. The project required modifying the compiler to allocate memory compatible with a mark and sweep algorithm, and adding the mark and sweep algorithm to the virtual machine. Computer Science faculty should take note that this was all completed by an undergraduate student within a year’s time, and that such challenges can reasonably be accomplished by undergraduate seniors.

INTRODUCTION

Challenges of the nature described in this paper are generally reserved for graduate students, and are considered outside the grasp of undergraduates. Computer Science faculty and students alike will be interested to note that the preceding project was completed entirely by an undergraduate senior. It is also interesting to note that the project was completed by an average student of little academic achievement, and that a Compiler, Assembler and Multi-Processed Virtual Machine with Garbage Collection were written within a year’s time.

As part of an undergraduate capstone, an Assembler, Virtual Machine and Compiler were implemented. The two-pass Compiler performs Lexical and Syntax analysis in the first pass, and Semantic analysis and Intermediate code generation in the second pass. Using Intermediate code as input, the Compiler then generates target code (assembly) that can be fed to the Assembler to generate byte-code. The byte-code can then be loaded into the Virtual Machine for execution [1]. Through independent study, a garbage collector was added to the virtual machine, which included extensive changes to the compiler.

The compiler had to be modified to place by-reference parameters onto the run-time stack first. An additional parameter is also added that counts the number of by-reference parameters. The counter is needed by the Mark and Sweep algorithm to determine the location of the by-reference parameters within an Activation Record.

To support the mark and sweep garbage collection algorithm, the virtual machine had to be modified to allocate memory from a list of available blocks. The mark and sweep algorithm is triggered when a call to allocate memory detects no free blocks. In the mark phase of the algorithm, the run-time stack is traversed searching for points that reference blocks allocated on the heap. Any block of memory reachable from the run-time stack must be marked as in use. During the sweep phase of the algorithm, the heap is searched looking for any blocks not marked as in use during the mark phase.
Screenshot from 2015-10-09 13:18:55

COMPILER MODIFICATIONS

The compiler was originally written to pass parameters to a function call via an activation record in the order they were written in the source language (a language called KXI, which is similar to java). It was necessary for the compiler to segregate between by-reference and by-value parameters. The mark phase of the algorithm must know the location of every by-reference parameter within a function calls’ activation record. See the ordering of variables in the current Activation Record of Figure 1. Because the variables are segregated, references are easily located based on offsets. For example, the first reference is located by an offset of 4*sizeof(int) from the base of the activation record (the return address, previous activation record pointer and reference counters are all integers), and the second reference is offset 5*sizeof(int) from the base.

The mark phase of the algorithm needed a special field inserted in each activation record that counts the number of by-reference parameters. This field was added in the activation record in such a way that the mark phase could iterate over each by-reference parameter and set the mark bit in the corresponding block for each object allocated on the heap. The field is referred to as the Reference Counter in Figure 1. The reference counter in this activation record tells us that there are 2 references. If we decremented the reference counter to 1, for example, the second reference on the stack would be interpreted as an integer.

VIRTUAL MACHINE MODIFICATIONS

In order to make space allocation more efficient, the heap was separated into large and small blocks. Bit vectors were used to keep track of which blocks are allocated on the heap.

An instruction was added to the virtual machine for allocating memory. Prior to the instruction, memory allocation consisted of just moving a pointer within the heap. The new allocation instruction calls the mark and sweep algorithm. If there is space available on the heap, the instruction returns a pointer to that block and marks the block as unavailable within one of the vectors that tracks all blocks in the heap.

If no available space is found, garbage collection is started. The algorithm must calculate the location of the activation record for the current function call then calculates the offset to the by-reference counter field in the activation record. Now having the number of pass by-references parameters in the current activation record, the algorithm can calculate the offset to each allocated block on the heap and set its mark bit to in use.

The algorithm must recursively follow references allocated inside of each block. This was achieved by organizing objects within a block in a similar manner to how function calls are organized in an activation record. In this way, lists, trees and even recursive data structures allocated on the heap can all be traversed and marked. In Figure 1, the mark phase will follow all references inside of Small Block A, so Small Block B is also marked.

Once all objects (blocks) and descendant objects have been marked, the algorithm calculates the location of the previous activation record. The same process of following references and marking objects proceeds for each activation record until all function calls on the run-time stack have been searched.

The sweep phase of the algorithm now iterates over the entire heap, checking the mark bit. If the mark bit is set (the block is in use), it clears the bit and moves on. This means that the block has a live reference to it which originated in an activation record that is currently on the run-time stack. Blocks A, B and D in Figure 1 have references pointing to them. These blocks will be un-marked and will remain allocated.

If the mark bit is not set, the algorithm clears the relevant marker in the vector of available blocks, freeing the block for reuse (See Small Block C in Figure 1) [2]. This allocated block will be freed during the sweep phase because it has no references pointing to it on the run-time stack.

CONCLUSION

This method of garbage collection is effective, but did prove to be inefficient. Because the algorithm isn’t activated until there is no remaining free space, the algorithm isn’t suitable for real time applications. The algorithm could be modified to operate incrementally, but it would still cause an occasional lag. These are known problems of garbage collection.

The greatest achievement of this project was the recognition of what can be accomplished by undergraduate seniors. Computer Science faculty should recognize that computing projects of this caliber can reasonably be expected in an undergraduate senior project course.

FUTURE WORK

The primary author has started work on an hp-ux pa-risc virtual machine. The first obstacle will be setting up the correct environment, based on descriptions in the pa-risc specifications. The second will be translating the pseudo code in the specification into C. A compiler/translator will be written to automatically convert the specification pseudo code into C.

A significant part of the project will be writing the loader, since it will need to include things such as run time linking. Ideally, the virtual machine will run at boot time and will include a boot loader. This would allow pa-risc software to run on virtually any hardware.

REFERENCES

[1] Mulder, D., Welborn, C., Lessons in converting from python to c++, Journal of Computing Sciences in Colleges, 29(2), 49-57, December 2013, http://dl.acm.org/citation.cfm?id=253542
[2] Jones, R., Lins, R. D., Garbage collection: Algorithms for automatic dynamic memory management, West Sussex, England

© CCSC, (2014). This is the author’s version of the work. It is posted here by permission of CCSC for your personal use. Not for redistribution. The definitive version was published in The Journal of Computing Sciences in Colleges, {volume 30, number 2, December 2014}, http://dl.acm.org/.

the avatar of Just Another Tech Blog

Deploying Configuration Profiles in OSX using QAS Group Policy

Here’s an alternative to applying Configuration Profiles in OSX without using an MDM client. Profiles are deployed using Group Policy over SMB, so you don’t have to open APN ports to Apple.
QAS is an AD bridge tool for unix/linux systems (including mac) that also provides Group Policy support. You can view more details here.

QAS Group Policy lets you specify Group Policy settings inside the Group Policy Management Editor, the same way you’d apply settings for a Windows host.
Screenshot from 2015-10-08 14:48:40It works similar to Apple’s Profile Manager.

Screenshot from 2015-10-08 14:54:54

You can also create custom profiles by writing preference manifests. The preference manifests are converted to Configuration Profiles before they’re applied on the OSX host.

On the OSX host, settings are retrieved from Group Policy, and installed as Configuration Profiles.

Screenshot from 2015-10-08 15:22:01

the avatar of Frédéric Crozat